フィルターのクリア

Plot time on x-axis with certain intervals

12 ビュー (過去 30 日間)
Vlatko Milic
Vlatko Milic 2021 年 11 月 18 日
コメント済み: Star Strider 2021 年 11 月 21 日
Hi Matlab friends,
I want to plot a data set in which I have data of one minute intervals. However, the data set is big and I would only like to plot the the year/month/day quarterly. As it is, the time steps are in 250000 x 1 cell. I can convert them to categorical arrays but do not know how to proceed with the plotting.
Kind regards

採用された回答

Star Strider
Star Strider 2021 年 11 月 18 日
Try something like this —
tdr = duration(minutes(1:250000));
tdt = datetime([2021 01 01])+tdr;
% Q1 = t(1435:1445)
y = sin(2*pi*minutes(tdr)*10/minutes(tdr(end)));
figure
plot(tdt, y)
grid
xticks(tdt(1:90*1440:end))
xtickformat('QQQ')
Make necessary changes to get the desired result.
.
  8 件のコメント
Vlatko Milic
Vlatko Milic 2021 年 11 月 21 日
thank you, i finally got it to work. Had some problems with the column in which the dates where.
Star Strider
Star Strider 2021 年 11 月 21 日
As always, my pleasure!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および 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