フィルターのクリア

Referencing a position for a subplot

3 ビュー (過去 30 日間)
Lui
Lui 2019 年 6 月 6 日
コメント済み: Lui 2019 年 6 月 6 日
Hi everyone, Can someone help me rewrite the code below so that each title on my subplot can reference the nth hour. For example the 24th plot should read like Hourly Variations for Hour 24 Demand. Unfortunately I cannot work around this. Thank you.
for n=1:24
for k=4
subplot(6,k,n)
plot(MJHourly(n,:));
hold on
plot(WJHourly(n,:));
hold off
xlabel('Day' );
ylabel('Demand');
title('Hourly Variations for Hour',n,'Demand')
end
end

採用された回答

dpb
dpb 2019 年 6 月 6 日
編集済み: dpb 2019 年 6 月 6 日
title(sprintf('Hourly Variations for Hour %d Demand',n))
  1 件のコメント
Lui
Lui 2019 年 6 月 6 日
Thanks @dpq. Works perfectly

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by