|
Hi,
CELLFUN may help :
[i,j]=find(cellfun(@(x)ismember(6,x),r))
"biosea Kim" <sinae76@hotmail.com> wrote in message
<f8va1g$c5m$1@fred.mathworks.com>...
> r=cell(10);
> r{1,1}=1:5;
> r{1,5}=6:10;
>
> In the example abvoe, I would like to know the location of
> 6, which is the 5th array of cell. I used intersect or
> ismember to find the location, but it didn't work. It says
> that it should be "string" in order to use "intersect" or
> "ismember" in cell array. I am trying to avoid loop and
> "string" to perform such functions in huge simulations.
>
> In the same example above, I also would like to find the
> first empty cell. Would you help me to do it? I used a loop
> "for", but in my huge simulations, I would like to avoid
> this loop.
>
> Thanks in advance.
|