How to convert time column into a regular array?
Ältere Kommentare anzeigen
I have a table with first column as time series, and other columns as other parameters that changes with time. I want to convert the time series into an array for plaotting. I tried following code:
A_time = A(:,1);
A_time_array = table2array(A_time);
This method works for all the numeric columns. However, it errors out in the time column. Can someone suggest a better way?
1 Kommentar
Stephen23
am 21 Jan. 2022
"Can someone suggest a better way?"
Convert the "time series" to datetime objects and plot using them.
Akzeptierte Antwort
Weitere Antworten (1)
Jon
am 21 Jan. 2022
t = seconds(A_time.Time - A_time.Time(1))
1 Kommentar
Anjali Mishra
am 21 Jan. 2022
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!