Path: news.mathworks.com!not-for-mail
From: "Branko" <branko_b@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: find function
Date: Mon, 5 Jan 2009 13:00:05 +0000 (UTC)
Organization: National Institute of Biology
Lines: 9
Message-ID: <gjt08k$mt1$1@fred.mathworks.com>
Reply-To: "Branko" <branko_b@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1231160405 23457 172.30.248.37 (5 Jan 2009 13:00:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Jan 2009 13:00:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 237386
Xref: news.mathworks.com comp.soft-sys.matlab:509838


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.