How to repeat a for loop n times
210 ビュー (過去 30 日間)
古いコメントを表示
end
States
Basically it outputs an array of size (N,1) consisting of 1s and -1s.
How can I repeat this array for example 5 times using the updated values of 'States', whilst displaying the results of each loop?
1 件のコメント
James Tursa
2016 年 11 月 30 日
"... using the updated values of 'States' ..."
What does this mean? I don't see 'States' used anywhere in the loop. Certainly you could wrap your current loop inside another loop, but how is 'States' supposed to be used in this loop?
採用された回答
James Tursa
2016 年 11 月 30 日
Is this all you are trying to do?
n = number of times to repeat the loop
States = zeros(size(N,1));
for k=1:n
for ii = 1:numel(AgentZScore)
% etc
end
States
end
1 件のコメント
その他の回答 (2 件)
参考
カテゴリ
Help Center および 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!