0

我有一列有 24 个值00, 01, 02, .... , 23

在 MATLAB 中转换为00:00, 01:00, 02:00, 03:00 ... 23:00.

4

2 回答 2

1

尝试:

vals = cellstr(num2str((0:23)','%02d'));
vals = strcat(vals, ':00');
于 2012-08-10T18:57:04.873 回答
0
>> t = (0 : 23) / 24;
>> s = datestr(t, 'HH:MM');
于 2012-08-13T17:57:33.897 回答