Date: Sep 19, 2009 12:07 PM
Author: Paul Skvorc
Subject: Re: Combinations, iterations, indices and file names

"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