nested for loop help
1 view (last 30 days)
Show older comments
Hello,
I am trying to use a nested for loop which calls a separate function within the loop. The goal is to generate a new matrix which is essentially 25 "trials" of the inner function. What is happening when I run the code is that the first column of the Results matrix is correct, while each subsequent column remains all zeros. Can anyone spot my mistake? Any help is greatly appreciated!
Here's my code:
Results = zeros(size(C,1),25);
for c = 1:25
for r = 1:size(C,1);
[MF,YF,Mult,Check] = YieldForce(C,T);
Results(:,1)=Check(:,1);
end
end
Jeremy
0 Comments
Accepted Answer
More 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!