Read a time column in a csv (convert 'char' to date) with readtable
Show older comments
I am a new user of Matlab and I can't find an easy answer to a simple question: how can I use readtable for csv and recognize the first column as a date?
Here is my file Cp.csv (separator ";") :
date ; Cp
10/03/2005 12:30:00;1.07266
10/03/2005 13:00:00;4.70812
10/03/2005 13:30:00;3.91713
10/03/2005 14:00:00; 1.01443
10/03/2005 14:30:00; 1.20241
10/03/2005 15:00:00; 4.78315
10/03/2005 15:30:00;1.55072
I tried the following code:
t=readtable('Cp.csv','Format',%{dd/MM/yyyy HH:mm:ss}D%f')
I keep on getting the following error:
Undefined function or method 'readtable' for input arguments of type 'char'
Thanks in advance for helping
Accepted Answer
Categories
Find more on Time Series Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!