필터 지우기
필터 지우기

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 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