Build a matrix for each loop output
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Helder Maranhão
am 5 Mär. 2022
Kommentiert: Helder Maranhão
am 6 Mär. 2022
Dear all
I would like to store each output from a loop to a matrix M.
I have some dificulties due to indexing.
Could someone plese give me a help on this problem?
Thank you very much

2 Kommentare
Akzeptierte Antwort
Matt J
am 6 Mär. 2022
M=zeros(3,4);
for j=1:3
As_prov=As.Asst>Asneg(j);
i=find(As_prov,1,'first')
M(j,1)=As.n1(i);
M(j,2)=As.dbL1(i);
M(j,3)=As.n2(i);
M(j,4)=As.dbL2(i);
end
Weitere Antworten (0)
Siehe auch
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!