フィルターのクリア

For loop nested plotting

1 回表示 (過去 30 日間)
Ileana Gonzalez
Ileana Gonzalez 2019 年 12 月 8 日
コメント済み: Ileana Gonzalez 2019 年 12 月 8 日
figure
plot(T,Cost)
Hi,
I have an overall for loop and then there are three nested for loops (one nested loop for each graph). I'm using linspace to run through 10 iterations for the three for loops and when I run my code I get 30 graphs. How do I only get the last three graphs from the 10th iteration?
Thank you.

採用された回答

Jesus Sanchez
Jesus Sanchez 2019 年 12 月 8 日
Use a if-else expression:
if current_iteration == 10
plot(T,cost)
end
  1 件のコメント
Ileana Gonzalez
Ileana Gonzalez 2019 年 12 月 8 日
Thank you so much!!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by