How to save output of double loop as a matrix?

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

 Risposta accettata

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 Commenti

Thank you very much.
As always, my pleasure!
.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by