Plotting dates on x-axis
古いコメントを表示
Hello! I have a 339x1 cell with dates in the format (ex. : 2015-05-01, 2015-05-04), and a 339x1 double with corresponding numbers. I'm trying to figure out how to plot the data with the dates on the x axis and numbers on the Y, but it gives me an error trying to plot data from a cell. I tried using cell2mat, but that just gives me a 339x10 char which also can't be plotted. Pretty new to Matlab, would really appreciate any help!
採用された回答
その他の回答 (1 件)
Peter Perkins
2015 年 5 月 13 日
An alternative to Star Strider's suggestion, if you are using MATLAB R2014b or later, would be
plot(datetime(datecell),y)
That's it.
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!