How to save output of double loop as a matrix?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ammy
am 19 Sep. 2021
Kommentiert: Star Strider
am 20 Sep. 2021
for i=1:m
for j=1:n
A=myfunction(...)
end
end
where the output A is the square matrix.
How to save output A for each iteration
0 Kommentare
Akzeptierte Antwort
Star Strider
am 19 Sep. 2021
Since ‘A’ is a matrix, save it as a cell array —
for i=1:m
for j=1:n
A{i,j} = myfunction(...)
end
end
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!