Filter löschen
Filter löschen

how to save the results got from a double for

2 Ansichten (letzte 30 Tage)
Francesco Grechi
Francesco Grechi am 4 Apr. 2021
Beantwortet: Walter Roberson am 4 Apr. 2021
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Apr. 2021
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

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by