Convert table and plot dates
Mostrar comentarios más antiguos
Hi,
I am kinda struggeling with a simple problem. I am trying plot the data of a table; but i can't get seem to conver the data into numbers and plot them.
The table looks like this.
Date Data1 Data2
________________ _____________ ____________
'12-07-2018 21:45' '-233.05' '-221.68'
'12-07-2018 22:00' '-233.33' '-231.18'
'12-07-2018 22:15' '-232.67' '-227.91'
'12-07-2018 22:30' '-232.95' '-226.35'
'12-07-2018 22:45' '-233.18' '-226.14'
'12-07-2018 23:00' '-233.02' '-228.94'
I tried using str2num etc. but nothing works.
3 comentarios
Peter Perkins
el 7 de Jun. de 2019
Kojiro answered the question per se, but the real question is how you ended up with that table to begin with. If you have a CSV file, or a spreadsheet, you should use readtable (or in recent versions readtimetable). That would typically give you a table with a datetime and two doubles.
There may be something funny in your file, though.
Tim W.
el 7 de Jun. de 2019
Peter Perkins
el 19 de Jun. de 2019
If you are using readtable, use detectimportoptions and force the column to be read in as numeric. A simpler version is to specify the Format parameter.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!