From: Matt Dunham on
Luna Moon <lunamoonmoon(a)gmail.com> wrote in message <91f4462c-6998-451d-a192-5cb540e7e99b(a)k9g2000vbl.googlegroups.com>...
> Hi all,
>
> If I have a cell called A,
>
> let's say A={'aa', 'bb', 'cc'},
>
> what's the most efficient way to do
>
> find(A=='aa')?
>
> It seems getting an error in Matlab?

find(cellfun(@(s)strcmp(s, 'aa'), A)
From: Jan Simon on
Dear Luna!

> A={'aa', 'bb', 'cc'},
> what's the most efficient way to do
> find(A=='aa')?
>
> It seems getting an error in Matlab?

"It seems"?! Please read and post the exact error message. It tells exactly what the problem is.
Try this:
find(strcmp(A, 'aa'))
In a lot of cases logical indexing is much faster and the FIND can be omitted.

Good luck, Jan