How to save output of double loop as a matrix?

5 vues (au cours des 30 derniers jours)
Ammy
Ammy le 19 Sep 2021
Commenté : Star Strider le 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

Réponse acceptée

Star Strider
Star Strider le 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 commentaires
Ammy
Ammy le 20 Sep 2021
Thank you very much.
Star Strider
Star Strider le 20 Sep 2021
As always, my pleasure!
.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by