以下对我有用(在 Octave 中,但在 MATLAB 中应该相同):
>> [num,txt,raw]=xlsread('dates.xls','A1:A4')
num =
4.1243e+004
4.1243e+004
4.1243e+004
4.1243e+004
txt = {}(0x0)
raw =
{
[1,1] = 4.1243e+004
[2,1] = 4.1243e+004
[3,1] = 4.1243e+004
[4,1] = 4.1243e+004
}
>> datestr(num+datenum(1900,1,1,0,0,0)-2)
ans =
30-Nov-2012 00:42:00
30-Nov-2012 00:47:00
30-Nov-2012 00:56:00
30-Nov-2012 01:01:00
>> whos ans
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 4x20 80 char
Total is 80 elements using 80 bytes
查看datestr
各种输出格式选项的功能。
阿尔诺