How would I rewrite this loop to work?
古いコメントを表示
I want this loop to plot three curves for T = 0,1 and 2. I keep getting error messages.
T = 0;
X2 = [0:0.1:2];
Y2 = [0:0.1:2];
while T <=2
Y2 = T.^2.*log(X2);
plot(Y2)
T + 1;
end
回答 (1 件)
Fangjun Jiang
2020 年 3 月 23 日
0 投票
Hint:
need to be "T=T+1;"
To plot to a different figure, run figure() first.
3 件のコメント
Chas Seldon
2020 年 3 月 23 日
Chas Seldon
2020 年 3 月 23 日
Fangjun Jiang
2020 年 3 月 23 日
use "hold on"
カテゴリ
ヘルプ センター および File 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!