how to use a foor loop
Show older comments
Hi
I am writing a code that uses a lot of repetitions for certain parts. The code is attached. Now I am looking for a way to more efficiently make that code simpler with a for loop. The repetition part is the use of variable U which varies from 1 to 13. Can anyone give a suggestion on how to do that? Thank you.
Accepted Answer
More Answers (1)
Image Analyst
on 24 Apr 2017
0 votes
Yeah, good luck with that one. Looks like alphabet soup. My only suggestion is to take the repeated lines of code (wherever they are) and make them into a function.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!