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 19:08:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 11
Message-ID: <h2ti2h$959$1@fred.mathworks.com>
References: <h2oif2$g5h$1@fred.mathworks.com> <h2okru$frv$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1246907281 9385 172.30.248.37 (6 Jul 2009 19:08:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 19:08:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:553188


"Matt Fig" <spamanon@yahoo.com> wrote in message <h2okru$frv$1@fred.mathworks.com>...
> If you don't have bwlabel, this should work:
> 
> D = diff(findstr(a,1));
> diff([0 find(D~=1) length(D)+1])
> 
> caveat: I didn't test this out on MATLAB, this PC doesn't have it.  I think this will work though!

Matt, Make a test for you and it fails when a = 0 ! Any quick fix?

Bruno