MATLAB Answers

Making graph at the every for loop

6 ビュー (過去 30 日間)
Najam us Saqib Fraz
Najam us Saqib Fraz 2020 年 10 月 20 日
回答済み: Star Strider 2020 年 10 月 20 日
I have a for loop,which runs for 14 times.After the end of each loop it produces a plot,which means that whole program produces 14 plots.I don't want 14 plot,but each line on single graph.A one plot that have 14 lines at it.

  0 件のコメント

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

回答 (1 件)

Star Strider
Star Strider 2020 年 10 月 20 日
First, if you are defining each plot in a separate figure, remove the figure call in the loop and put it before the loop.
Just after the figure call before the loop, use the hold function:
figure
hold on
for ...
...
end
hold off
legend
or something similar.
That should do what you want.

  0 件のコメント

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by