Sorting data from time stamp in excel

1 view (last 30 days)
Terez
Terez on 1 Jul 2014
Answered: dpb on 1 Jul 2014
I have data in excel that has two columns and 3,000 rows. The first column is date and time in the format month/date/year hour:minute:secondAM/PM. I'm trying to load this data into matlab and put the year, month, date and time in separate columns so I end up with five columns.
I can use the load function to get the excel data into matlab but I'm not sure how to separate the time stamp data into different columns.

Answers (1)

dpb
dpb on 1 Jul 2014
Why do you need separate columns--what are you going to do with them?
If you think you must, use datevec to parse the string format.
doc datevec
doc datenum
Read the section under data import/spreadsheets on converting Excel date values for background working with Excel dates other than text.

Community Treasure Hunt

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

Start Hunting!