Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Clever way to access matrix indices EXCEPTING certain values?
Date: Fri, 21 Dec 2007 21:01:36 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <fkh9jf$dr1$1@fred.mathworks.com>
References: <fkh7sq$d4u$1@fred.mathworks.com> <fkh856$hj9$1@fred.mathworks.com> <fkh8hn$4fb$1@canopus.cc.umanitoba.ca>
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 1198270896 14177 172.30.248.37 (21 Dec 2007 21:01:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Dec 2007 21:01:36 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215962
Xref: news.mathworks.com comp.soft-sys.matlab:443345



Wow! Even nicer!

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in 
message <fkh8hn$4fb$1@canopus.cc.umanitoba.ca>...
> 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)