For loop nested plotting

4 vues (au cours des 30 derniers jours)
Ileana Gonzalez
Ileana Gonzalez le 8 Déc 2019
Commenté : Ileana Gonzalez le 8 Déc 2019
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.

Réponse acceptée

Jesus Sanchez
Jesus Sanchez le 8 Déc 2019
Use a if-else expression:
if current_iteration == 10
plot(T,cost)
end
  1 commentaire
Ileana Gonzalez
Ileana Gonzalez le 8 Déc 2019
Thank you so much!!!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Specifying Target for Graphics Output dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by