Plot data with date and time as the x axis
62 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Can anyone help me plot this table data? I want to have the date and time as x - axis and the other variables as 6 differnent plots all in the same
figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/914689/image.png)
Thanks,
Amir
0 件のコメント
採用された回答
Cris LaPierre
2022 年 3 月 4 日
Read the table in as a table using readtable. You will want to make sure column 1 is read in as a datetime. This 'should' happen automatically, but may depend on your version of MATLAB. Once in MATLAB, you can just plot using the datetime variable as your x input. As a datetime, it will automatically show date and time.
3 件のコメント
Cris LaPierre
2022 年 3 月 7 日
編集済み: Cris LaPierre
2022 年 3 月 7 日
Try this syntax: stackedplot(___,'XVariable',xvar)
xlsx_name = 'C:\\Air Temperature\MQLoad (1).xlsx'
tab = readtable(xlsx_name);
stackedplot(tab,'XVariable','Var1')
If that doesn't work, please share your spreadsheet. You can attach it to your post using the paperclip icon.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!