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 22:45:42 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <fkhfmm$3al$1@fred.mathworks.com>
References: <fkh7sq$d4u$1@fred.mathworks.com> <fkh856$hj9$1@fred.mathworks.com> <fkh8hn$4fb$1@canopus.cc.umanitoba.ca> <fkh9jf$dr1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1198277142 3413 172.30.248.35 (21 Dec 2007 22:45:42 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Dec 2007 22:45:42 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870065
Xref: news.mathworks.com comp.soft-sys.matlab:443356



"Ian Clarkson" <ian.clarkson@gesturetek.com> wrote in 
message <fkh9jf$dr1$1@fred.mathworks.com>...
> 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]));



abc2 = abc ; % if you want to keep the original indices
abc2(ind) = [] ;

hth
Jos