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 05:38:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <gp29vp$729$1@fred.mathworks.com>
References: <gp295g$dn1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1236577081 7241 172.30.248.38 (9 Mar 2009 05:38:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Mar 2009 05:38:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1708920
Xref: news.mathworks.com comp.soft-sys.matlab:523406


"Husam Aldahiyat" <numandina@gmail.com> wrote in message <gp295g$dn1$1@fred.mathworks.com>...
> Hello,
> I created an algorithm and everything works fine, but there are line that I think can be made shorter using a command or technique I don't know about. Here are the lines:
> 
> sign2=round(((~abs(sign(round(diff([con(1),con(3)])))))*(-2*((~(~(con(3)-con(2)+1)))*...
> (~(~(con(3)-con(2)-2))))+1))+~(~abs(sign(round(diff([con(1),con(3)]))))));
> 
> 
> sign1=round(~(~abs(sign(round(diff([con(1),con(3)])))))*...
> 	-2*(~(~(sum(ismember(diff(con),1)))))+1);

A little description will help us to help you. What does con represent, what are typical values it contains, what size is it? What values do you expect sign1 and sign2 to have?
Darren