nested for loop help
古いコメントを表示
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 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!