Borrar filtros
Borrar filtros

Storing for loop calculations

1 visualización (últimos 30 días)
Eric
Eric el 13 de Mayo de 2014
Respondida: Image Analyst el 14 de Mayo de 2014
I am interested in storing all the results of a for loop in separate matrices. How do I write a function such that Matlab will store the matrix result of, say, the ith iteration as [Ai]?

Respuestas (1)

Image Analyst
Image Analyst el 14 de Mayo de 2014
for k = 1 : whatever
A(k) = blahblahFooBar;
end
It's recommended to use variables other than i and j (imaginary variables) as loop indexes.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by