How to convert time column into a regular array?
Mostrar comentarios más antiguos
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 comentario
Stephen23
el 21 de En. de 2022
"Can someone suggest a better way?"
Convert the "time series" to datetime objects and plot using them.
Respuesta aceptada
Más respuestas (1)
Jon
el 21 de En. de 2022
t = seconds(A_time.Time - A_time.Time(1))
1 comentario
Anjali Mishra
el 21 de En. de 2022
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!