How to convert a cell array into a datetime array

I have a 29 x 1 cell array which contains 29 1 x 1 datetime variables. I wish to plot the 29 values as an x axis, but am unable to as Matlab registers them as an array of cells instead of date times. Can this be converted? Thanks!

 Respuesta aceptada

Walter Roberson
Walter Roberson el 16 de Feb. de 2018
x = vertcat(output{2,6}{:});
Note: you will need R2016b or later to use datetime variables as the x axis in plot()

1 comentario

Peter Perkins
Peter Perkins el 17 de Feb. de 2018
Support for plotting datetimes expanded in R2016b, but plot should work ok in R2014b or later, at least for the basics.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 16 de Feb. de 2018

Comentada:

el 17 de Feb. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by