Mimic the std function from octave.