Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Consecutive Numbers !
Date: Fri, 21 Dec 2007 02:26:49 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <fkf899$9gu$1@fred.mathworks.com>
References: <fkf1sr$a05$1@fred.mathworks.com> <fkf5hg$jta$1@fred.mathworks.com> <fkf60b$an6$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
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 1198204009 9758 172.30.248.37 (21 Dec 2007 02:26:49 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 21 Dec 2007 02:26:49 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:443256


"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