Clear Filters
Clear Filters

Storing for loop calculations

1 view (last 30 days)
Eric
Eric on 13 May 2014
Answered: Image Analyst on 14 May 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]?

Answers (1)

Image Analyst
Image Analyst on 14 May 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.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!