フィルターのクリア

how to save the results got from a double for

2 ビュー (過去 30 日間)
Francesco Grechi
Francesco Grechi 2021 年 4 月 4 日
回答済み: Walter Roberson 2021 年 4 月 4 日
i have the the following double for, simMensile output a vector of 12 values and and it's repeated for A times. i want to save in a matrix (eg. TOTAL) all vector of simMensile. for example if A = 3 simMensile will works for 3 times so i want to save the 36 (12*3) results in TOTAL
for aggregato = 1:A
for mese =1:12
simMensile(mese) = randi([AC(mese,1)-2*AC(mese,2), AC(mese,1)+2*AC(mese,2)]);
end
end

採用された回答

Walter Roberson
Walter Roberson 2021 年 4 月 4 日
for aggregato = 1:A
for mese =1:12
simMensile(mese, aggregato) = randi([AC(mese,1)-2*AC(mese,2), AC(mese,1)+2*AC(mese,2)]);
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by