Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How can I make these lines shorter?
Date: Mon, 9 Mar 2009 06:09:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 8
Message-ID: <gp2bq0$500$1@fred.mathworks.com>
References: <gp295g$dn1$1@fred.mathworks.com> <gp29vp$737$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1236578944 5120 172.30.248.35 (9 Mar 2009 06:09:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Mar 2009 06:09:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1708920
Xref: news.mathworks.com comp.soft-sys.matlab:523410


My apologies for multiple posts. I'm getting load errors for every page.

Try the following
~abs(sign(round(diff([con(1),con(3)])))) the same as isequal(con(1),con(3))
and
~(~(sum(ismember(diff(con),1)))) the same as any(diff(con)==1)
Hth
Darren