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 2022년 12월 8일
you mean something like that? or do you want another format?
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
ax = gca;
ax.XAxis.TickLabelFormat = 'h';
ax.XAxis.MinorTickValues = hours(0:0.25:24);
ax.XAxis.MinorTick = 'on';


Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by