Path: news.mathworks.com!not-for-mail
From: "ken " <ken4aver@yahoo.com.tw>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Trouble - floor() BUG? or.... merely my faults?
Date: Tue, 17 Jun 2008 14:34:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <g38i0q$gk$1@fred.mathworks.com>
References: <g37urn$4eh$1@fred.mathworks.com> <g383c1$92q$1@fred.mathworks.com>
Reply-To: "ken " <ken4aver@yahoo.com.tw>
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 1213713242 532 172.30.248.38 (17 Jun 2008 14:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Jun 2008 14:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1223870
Xref: news.mathworks.com comp.soft-sys.matlab:474252



"David " <dave@bigcompany.com> wrote in message <g383c1
$92q$1@fred.mathworks.com>...

> 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?
> 

:P...I'd notice about that and more explicitly state 
problems.

And thanks, David.
I have done a Computed Tomography simulation code few weeks 
ago, and have encountered this problem....it rarely happens 
and happened.

Any idea to rectify such embarrassment or anyone knows any 
related function in MATLAB could do line-pixel mapping? Or 
to look for Line-drawing algorithms?

Regards and thanks in advance.