How to change the following code to loop
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hello,every one.
I'm learning MATLAB, I don't know how to change the following code to loop, and it has confused me for a week. Can anyone help me? Thank you very very much!
Answers (2)
KSSV
on 6 Jun 2020
0 votes
Two ways to convert your code into a loop. I am assume that you want to run that code multiple times in a loop.
- Convert your code into a function and call the function in a loop. You can convert the code into a function by providing someinput and naming the function.
- Make a loop above the code.
5 Comments
Saiping Jiang
on 6 Jun 2020
KSSV
on 6 Jun 2020
loop is pretty simple in MATLAB..read about it.
Saiping Jiang
on 6 Jun 2020
Saiping Jiang
on 7 Jun 2020
KSSV
on 7 Jun 2020
0 votes
Perfect ...get back here if you have doubts in the present code.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!