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 21:04:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 5
Message-ID: <h2tos2$fe6$1@fred.mathworks.com>
References: <h2oif2$g5h$1@fred.mathworks.com> <987ab093-7a3a-4f31-a470-832243bcbce9@q40g2000prh.googlegroups.com> <dd44bfac-dbcb-4a24-aff0-e8d97d454878@m7g2000prd.googlegroups.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1246914242 15814 172.30.248.35 (6 Jul 2009 21:04:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 21:04:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:553240


Another (one-liner) solution:
 
find([0 a].*[~a 1])-find([1 ~a].*[a 0])

Bruno