Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Combinations, iterations, indices and file names
Replies: 7   Last Post: Sep 19, 2009 9:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Paul Skvorc

Posts: 13
Registered: 2/6/07
Re: Combinations, iterations, indices and file names
Posted: Sep 19, 2009 12:07 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Matt Fig" <spamanon@yahoo.com> wrote in message <h92t4v$9dh$1@fred.mathworks.com>...
> "Paul Skvorc" <pskvorc@biopar.com> wrote in message <h92r4o$3q7$1@fred.mathworks.com>...
> > Why use a cell array?
>
>
>
> Because it simplifies your iterations issue:
>
> % Use three images here.
> C{1} = rand(5); % Use imread or whatever to fill the cell.
> C{2} = rand(5);
> C{3} = rand(5);
> T = nchoosek(1:3,2); % Indices for comparison.
> % Now the comparison, store in cell array (pre-allocation not shown).
> for ii = 1:size(T,1)
> G{ii} = C{T(ii,1)} > C{T(ii,2)}; % Silly comparison for illustration only.
> end


I'll give it a try and let you know.

Thanks,
Paul



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.