How to convert time column into a regular array?
Mostra commenti meno recenti
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 Commento
Stephen23
il 21 Gen 2022
"Can someone suggest a better way?"
Convert the "time series" to datetime objects and plot using them.
Risposta accettata
Più risposte (1)
Jon
il 21 Gen 2022
t = seconds(A_time.Time - A_time.Time(1))
1 Commento
Anjali Mishra
il 21 Gen 2022
Categorie
Scopri di più su Data Type Conversion in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!