Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Clever way to access matrix indices EXCEPTING certain values?
Date: Fri, 21 Dec 2007 20:32:26 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <fkh7sq$d4u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1198269146 13470 172.30.248.37 (21 Dec 2007 20:32:26 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Dec 2007 20:32:26 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215962
Xref: news.mathworks.com comp.soft-sys.matlab:443339



I'm trying to access all matrix elements NOT having a given 
list of indices.

For instance,

abc=[5.8 3.8 2.2 5.8 0.2];
abc([1 3])
ans =
    5.8000    2.2000

That's a neat way to index the matrix. But I want something 
akin to this:

abc(![1 3])
ans =
    3.8000    5.8000 0.200

i.e. it gave me all elements not equal to 1 or 3. There 
must be an elegant way to do this that I'm slightly too 
dumb to figure out.