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!

 採用された回答

Walter Roberson
Walter Roberson 2018 年 2 月 16 日

0 投票

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

1 件のコメント

Peter Perkins
Peter Perkins 2018 年 2 月 17 日
Support for plotting datetimes expanded in R2016b, but plot should work ok in R2014b or later, at least for the basics.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by