2013-05-12 31 views
1

如何分离ddmmyyhhmmssdaymonthyearhourminutesecond)12位数字,并把在分离塔6中MATLAB?我现在总共需要7栏。例如,我已经以下字符串如何在MATLAB中将字符串分隔到不同的列中?

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

提示:第n个数字是'(X /(10^n))%10'其中'^'是指数运算符,'%'是模数运算符 – 2013-05-12 21:45:19

回答

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 
相关问题