Borrar filtros
Borrar filtros

how to save the results got from a double for

2 visualizaciones (últimos 30 días)
Francesco Grechi
Francesco Grechi el 4 de Abr. de 2021
Respondida: Walter Roberson el 4 de Abr. de 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

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Abr. de 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

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by