MATLAB: How to sort array of time format from min to max time value

arraysorttime format

Hi all,
I have a 2-dimension array which its elements are time format, such as 22:13:98. I want to sort each row of this array in the ascending format, I mean from minimum time to maximum time. Any help is appreciated.

Best Answer

  • help sort
    A = magic(5);
    If you want to convert your time data to a numeric representation for sorting, try datenum.
    help datenum