Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Picking Ones among Zeros
Date: Mon, 6 Jul 2009 18:17:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 14
Message-ID: <h2tf2t$ir1$1@fred.mathworks.com>
References: <h2oif2$g5h$1@fred.mathworks.com> <h2okru$frv$1@fred.mathworks.com> <h2scke$djp$1@fred.mathworks.com> <h2tdnq$fs9$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246904221 19297 172.30.248.38 (6 Jul 2009 18:17:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 18:17:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:553181


Since I wrote the SplitVec on FEX, I'm kind of lazy to think about using stock functions:

http://www.mathworks.com/matlabcentral/fileexchange/24255
 
[l first] = SplitVec(a,[],'length','first');
l1 = l(a(first)==1)

l1 =

     4
     7
     2

% Bruno