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일
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에 대해 자세히 알아보기

질문:

2018년 2월 16일

댓글:

2018년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by