フィルターのクリア

I want to plot plot(t,S) , plot(t,BT), plot(t,D), plot (t,I), and plot(t,R) separately, and not together in one plot. How do you plot these graphs separately ?

1 回表示 (過去 30 日間)
Anononymous Jones
Anononymous Jones 2020 年 4 月 24 日
回答済み: Tanisha Gosain 2020 年 6 月 19 日
figure
hold on
t=linspace(0,T,i+1);
plot(t,S)
plot(t,BT)
plot(t,D)
plot(t,BET)
plot(t,I)
plot(t,R)
hold off
title('SIRD FOR COVID-19 IN SOUTH AFRICA')
xlabel('Time') %% Days
ylabel('Surviving Population')
legend('Confirmed ', 'Infected', 'Recovered', 'Death', 'BT','BET')

回答 (1 件)

Tanisha Gosain
Tanisha Gosain 2020 年 6 月 19 日
Remove hold on and hold off from your code. Hold on retains the current axes and adds new plots onto the existing plot. You can read more about hold on and hold off here.

カテゴリ

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

タグ

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by