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!

 采纳的回答

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

1 个评论

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

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by