Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!m7g2000prd.googlegroups.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Picking Ones among Zeros
Date: Mon, 6 Jul 2009 13:34:03 -0700 (PDT)
Organization: http://groups.google.com
Lines: 17
Message-ID: <dd44bfac-dbcb-4a24-aff0-e8d97d454878@m7g2000prd.googlegroups.com>
References: <h2oif2$g5h$1@fred.mathworks.com> <987ab093-7a3a-4f31-a470-832243bcbce9@q40g2000prh.googlegroups.com> 
	<h2tmsr$6ko$1@fred.mathworks.com>
NNTP-Posting-Host: 128.195.202.164
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1246912445 4191 127.0.0.1 (6 Jul 2009 20:34:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 6 Jul 2009 20:34:05 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: m7g2000prd.googlegroups.com; posting-host=128.195.202.164; 
	posting-account=2xaS4woAAABMTlLr8rCm508E1dml7wGx
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; 
	Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 
	3.0.30618; MAXTHON 2.0),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:553226


On Jul 6, 1:30 pm, "Bruno Luong" <b.lu...@fogale.findmycountry> wrote:
> Siyi Deng <mr.siyi.d...@gmail.com> wrote in message <987ab093-7a3a-4f31-a470-832243bcb...@q40g2000prh.googlegroups.com>...
>
> > Here's another solution:
>
> > b = strfind(a,[1 0]) - strfind(a,[0 1])
>
> A quick fix for a=1 ? Heh?
>
> Bruno

fine,

b = strfind([0,a,0],[1 0]) - strfind([0,a,0],[0 1])

still a oneliner