How do I make a vector where the entries are months and years?
8 ビュー (過去 30 日間)
古いコメントを表示
So I have this data set that needs me to plot the months of the year on the x axis for the years 2006 to 2012. What I mean by this is that I want to know how to make an array whose first entry is "Jan-2006", the next is "Feb-2006", the next is "Mar-2006" etc. until I reach "Dec-2012" (total of 84 entries). Could someone help me with this? Thanks
0 件のコメント
回答 (2 件)
madhan ravi
2019 年 2 月 11 日
t = (datetime(2006,1,1):calmonths(1):datetime(2012,12,31)).'
t.Format='MMM-yyyy'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!