Filter löschen
Filter löschen

Storing for loop calculations

1 Ansicht (letzte 30 Tage)
Eric
Eric am 13 Mai 2014
Beantwortet: Image Analyst am 14 Mai 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]?

Antworten (1)

Image Analyst
Image Analyst am 14 Mai 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.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by