Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Trouble - floor() BUG? or.... merely my faults?
Date: Tue, 17 Jun 2008 10:24:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <g383c1$92q$1@fred.mathworks.com>
References: <g37urn$4eh$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 1213698241 9306 172.30.248.35 (17 Jun 2008 10:24:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Jun 2008 10:24:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 791003
Xref: news.mathworks.com comp.soft-sys.matlab:474194



"ken " <ken4aver@yahoo.com.tw> wrote in message 
<g37urn$4eh$1@fred.mathworks.com>...
> 
> Hi, guys...
> I'm new face here.
> 
> Is anybody could answer why the condition
>  happened being so weird.
> 
with the set of parameters giving you the problem this is 
where your error really is:
        y=m*(x_prime+1)+param1y; %CY(x_prime+1);
        y_prime=floor(y);

the calculation works out that y=3.799999999999999e+001 
which floor converts to 37... so it never gets past that 
point, eventually it probably runs out of memory as its 
stuck in an infinite loop building the array.  overall the 
code looks way over complicated for drawing a line, and as 
too many chances for things like this to throw it off.  
just what are you trying to do anyway?