Transforming Timestamps column into various columns

1 次查看(过去 30 天)
Hi all,
I'm with a problem and can't find the solution for it, hope you can help me.
I have this column;
Timestamps
01/01/2012 09:00
01/01/2012 10:00
01/01/2012 11:00
and now I want to slip it into 4 different columns with:
Day Month Year Hour
01 01 2012 9
The file is in excel.
Thanks.

采纳的回答

Andrei Bobrov
Andrei Bobrov 2013-11-26
data = {'01/01/2012 09:00'
'01/01/2012 10:00'
'01/01/2012 11:00'};
v = datevec(data);
out = v(:,1:4);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by