how to save the results got from a double for

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by