Path: news.mathworks.com!not-for-mail
From: Loren Shure <loren@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: find function
Date: Tue, 6 Jan 2009 07:50:28 -0500
Organization: The MathWorks
Lines: 18
Message-ID: <MPG.23cd1d9ec887b803989916@news.mathworks.com>
References: <gjt08k$mt1$1@fred.mathworks.com>
NNTP-Posting-Host: vpn-client-122-25-ah.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1231246221 3392 144.212.122.25 (6 Jan 2009 12:50:21 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 Jan 2009 12:50:21 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:510005


In article <gjt08k$mt1$1@fred.mathworks.com>, branko_b@hotmail.com 
says...
> Let's say that I have a random matrix:
> A=ceil(randn(10,1));
> and I want to find -1 and 2 values in the matrix. Which is done by following command
> a=find(A==-1);
> b=find(A==2);
> However I' d like to use single command which in this case is:
> c=find(A==-1 & A==2);
> But I got empty matrix.Where is the cache. 
> Thanks.
> 

will ismember help you out?

-- 
Loren
http://blogs.mathworks.com/loren