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!

 Réponse acceptée

x = vertcat(output{2,6}{:});
Note: you will need R2016b or later to use datetime variables as the x axis in plot()

1 commentaire

Support for plotting datetimes expanded in R2016b, but plot should work ok in R2014b or later, at least for the basics.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by