Path: news.mathworks.com!not-for-mail
From: "alan dinno" <alan_dinno@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Consecutive Numbers !
Date: Fri, 21 Dec 2007 03:42:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <fkfcm9$68f$1@fred.mathworks.com>
References: <fkf1sr$a05$1@fred.mathworks.com> <fkf5hg$jta$1@fred.mathworks.com> <fkf60b$an6$1@fred.mathworks.com> <fkf899$9gu$1@fred.mathworks.com>
Reply-To: "alan dinno" <alan_dinno@hotmail.com>
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 1198208521 6415 172.30.248.38 (21 Dec 2007 03:42:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Dec 2007 03:42:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1192926
Xref: news.mathworks.com comp.soft-sys.matlab:443260


"Roger Stafford" 
<ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
message <fkf899$9gu$1@fred.mathworks.com>...
> "alan dinno" <alan_dinno@hotmail.com> wrote in message 
<fkf60b$an6
> $1@fred.mathworks.com>...
> > "Roger Stafford" 
> > <ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
> > > Try this:
> > >  H = max(diff(find([1,diff(V)~=1,1])));
> > 
> > It gives me the error message:
> > 
> > ??? Error using ==> horzcat
> > All matrices on a row in the bracketed expression must 
> > have the same number of rows.
> > 
> > al
> -----------
>   My apologies.  I forgot that your V is a column 
vector, not a row vector.  For 
> a column vector use:
> 
>   H = max(diff(find([1;diff(V)~=1;1])));
> 
> Roger Stafford
> 
> 

Works nicely! Thanks, Roger!!
Alan