Plot datetime data from a cell array?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yufei Cao
am 25 Mär. 2021
Kommentiert: Yufei Cao
am 25 Mär. 2021
I have data set shown in fig. But I do not how to access to the data.
I try to use: plot(index{2:end, 1}, cell2mat(index(2:end, 2)), 'b'), but it does not work.
0 Kommentare
Akzeptierte Antwort
Stephen23
am 25 Mär. 2021
Bearbeitet: Stephen23
am 25 Mär. 2021
A cell array containing lots of scalar arrays indicates that your data is arranged sub-optimally. You would be much better off using a table, or perhaps two separate homogenous vectors (i.e. a datetime array and a numeric array).
Converting to two homogenous arrays is probably the easiest way to plot the existing (badly designed) data:
dt = [index{2:end,1}];
ix = [index{2:end,2}];
plot(dt,ix)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!