How to save output of double loop as a matrix?

1 visualización (últimos 30 días)
Ammy
Ammy el 19 de Sept. de 2021
Comentada: Star Strider el 20 de Sept. de 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

Respuesta aceptada

Star Strider
Star Strider el 19 de Sept. de 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 comentarios
Ammy
Ammy el 20 de Sept. de 2021
Thank you very much.
Star Strider
Star Strider el 20 de Sept. de 2021
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by