如何隔离ddmmyyhhmmss
(day
,month
,year
,hour
,minute
,second
)12位数编号并放在MATLAB
的单独6列中?我现在总共需要7列。例如,我有以下字符串
051210151255 (which is 05 day, 12 month, 2010 year, 15 hours, 12 minute, 55 second)
现在我需要7列(whole 12 digit number, dd, mm, yy, hh, mm, ss
)
答案 0 :(得分:0)
d = '051210151255';
output = zeros(1, 6);
for i=1:6
output(1, i) = str2num(d(i*2-1:i*2));
end
output = [str2num(d) output];
给出:
>> output =
051210151255 5 12 10 15 12 55