converting column of datetimes in excel to datenumbers in matlab

1 view (last 30 days)
hie everyone
I want to convert data in column C (labeled datetime) of the attached document to a column of date numbers in matlab, which are to be used as input variables for a neural network
please help

Accepted Answer

Mehmed Saad
Mehmed Saad on 13 Jul 2020
Edited: Mehmed Saad on 13 Jul 2020
T = readtable('zetdctestdata.xlsx');
T.datetime = cellfun(@(x)datenum(x,'mm/dd/yyyy HH:MM:SS'),T.datetime);
Mehmed Saad
Mehmed Saad on 15 Jul 2020
Edited: Mehmed Saad on 15 Jul 2020
Actual value in variable is 737076.458333333 but due to format it is rounding off
The default format for command window is Short
ans =
Change Format to long
format Long
ans =
But it is just for display purpose

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by