matrix per minute in plot per hour

4 ビュー (過去 30 日間)
Stef De Vos
Stef De Vos 2022 年 12 月 8 日
コメント済み: Stef De Vos 2022 年 12 月 8 日
I have a load profile matrix 96x1, a value for every 15min..
But I want to plot this in a graph with the plot figure of the 15min. data but with the x axis labeled in hour (per 4 values 1 indicator on the x axis, starting from 0 to 24h.
Can this be done?

採用された回答

Jonas
Jonas 2022 年 12 月 8 日
you mean something like that? or do you want another format?
plot((1:96)/4,rand(96,1));
xticks(0:3:24)
xlim([0 24]);
xlabel('time / h')
  1 件のコメント
Stef De Vos
Stef De Vos 2022 年 12 月 8 日
exactly this. probably a stupid question but I couldn't get it to work. Thanks for the help!

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

その他の回答 (1 件)

Bora Eryilmaz
Bora Eryilmaz 2022 年 12 月 8 日
Something like this?
for k = 0:20
x = minutes(15*k + linspace(0,15,96));
y = cumsum(rand(96,1));
p = plot(x,y);
hold on
end
ax = gca;
ax.XAxis.TickLabelFormat = 'h';
ax.XAxis.MinorTickValues = hours(0:0.25:24);
ax.XAxis.MinorTick = 'on';

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by