For loop nested plotting

3 次查看(过去 30 天)
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by