Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Combinations, iterations, indices and file names
Posted:
Sep 19, 2009 12:07 PM


"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 (preallocation 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



