use a Subroutine in a for loop

I have a big Matlab Script that gives me figures and text files as output , I want to run it several times and just change a variable in it. How can I do it

回答(1 个)

Star Strider
Star Strider 2016-9-12

0 个投票

You don’t give enough information for an exact reply.
I see two possibilities:
1. Create a function out of your script code and then call it with different arguments in a loop,
2. Nest it in a for loop as it currently exits, changing the variable you want in each iteration of the outer loop.
What you do depends on how your code is written and what you want to do with it.

类别

帮助中心File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

提问:

2016-9-12

评论:

2016-9-12

Community Treasure Hunt

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

Start Hunting!

Translated by