From: Adam Thibideau on
No sorry I did not. Maybe if you would have offered a little more explaination to your solution than "dont do this" i would have grasped it.
From: Matt Fig on
To be even more explicit, do something like this:

% pre-allocation goes here.
for ii = 1:5
interval(ii).min = min(rand(ii)); % For example
end
% Now look at: interval(4).min


OR this:


% pre-allocation goes here.
for ii = 1:5
interval_min{ii} = min(rand(ii)); % For example
end
% Now look at: interval_min{4}
From: Walter Roberson on
Adam Thibideau wrote:
> No sorry I did not. Maybe if you would have offered a little more
> explaination to your solution than "dont do this" i would have grasped it.

In your opinion, how long of a tutorial should we write in response to
each of the several hundred questions posted each day?
From: Saurabh Mahapatra on
Just a passing thought: If your code works in serial fashion, why don't you consider PARFORing it?

http://www.mathworks.com/access/helpdesk/help/toolbox/distcomp/brb2x2l-1.html

Thanks,

Saurabh
From: Rob Campbell on
"Adam Thibideau" <adam.thibideau(a)gmail.com> wrote in message <i2lgis$7d9$1(a)fred.mathworks.com>...
> No sorry I did not. Maybe if you would have offered a little more explaination to your solution than "dont do this" i would have grasped it.

You should try to digest the FAQ, the answer you received was the correct one. It is hard to manipulate variables if you create them in the way you describe. You will end up having to use the eval function, which is really not ideal. If you index as suggested then your code will be more elegant, compact and easy to understand. It will also make it easier to extract the data which you want.