Plot figures in loop as superimposed top on top
4 ビュー (過去 30 日間)
古いコメントを表示
Similar questions should have been asked however I couldn't get a solution.
Plot can superimpose these loop figures onto one another:
figure();
hold all
for i=1:2:11
y=i;
plot(x,y);
end
However, interestingly can't do the same here:
figure();
hold all
for i=1:2:11
y=x.^i;
plot(x,y);
end
What it does is plotting only the last figure. Any ideas why is this?
0 件のコメント
回答 (1 件)
KSSV
2016 年 11 月 19 日
編集済み: KSSV
2016 年 11 月 19 日
Used hold on after the plot inside loop.
5 件のコメント
Image Analyst
2016 年 11 月 20 日
Is x a vector or scalar? What is/are its value(s) exactly? Give code to generate x.
参考
カテゴリ
Help Center および File Exchange で Title についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!