Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Clever way to access matrix indices EXCEPTING certain values?
Date: Fri, 21 Dec 2007 20:43:35 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 16
Message-ID: <fkh8hn$4fb$1@canopus.cc.umanitoba.ca>
References: <fkh7sq$d4u$1@fred.mathworks.com> <fkh856$hj9$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1198269815 4587 192.70.172.160 (21 Dec 2007 20:43:35 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 21 Dec 2007 20:43:35 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:443342



In article <fkh856$hj9$1@fred.mathworks.com>,
Ian Clarkson <ian.clarkson@gesturetek.com> wrote:
>Never mind! I figured it out just after submitting it. My 
>solution:

>unwantedIndices = [1 3];
>wantedIndices = 1:length(abc);
>wantedIndices(unwantedIndices) = [];

>wantedValues = abc(wantedIndices);

wantedValues = abc(setdiff(1:length(abc),[1 3]));
-- 
   So you found your solution
   What will be your last contribution?
   -- Supertramp (Fool's Overture)