How to convert time column into a regular array?
Afficher commentaires plus anciens
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 commentaire
Stephen23
le 21 Jan 2022
"Can someone suggest a better way?"
Convert the "time series" to datetime objects and plot using them.
Réponse acceptée
Plus de réponses (1)
Jon
le 21 Jan 2022
t = seconds(A_time.Time - A_time.Time(1))
1 commentaire
Anjali Mishra
le 21 Jan 2022
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!