how to avoid writing a script for every input again
1 view (last 30 days)
Show older comments
I have a series of species and I need to get a matrix of each component using a for loop. I have to repeat the code for each species, though it does not seem to be a sensible way. I tried to use for loop to avoid the repetition but the thing is for loop replace the previous ones.
2 Comments
James Tursa
on 6 Mar 2018
The general advice here would be to write a function that contains the code common to the processing you need to do.
KSSV
on 7 Mar 2018
Write your code into a function......call the code and store the value for every loop. Show us your code..we will help you.
Answers (0)
See Also
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!