Path: news.mathworks.com!not-for-mail
From: "Tales " <roztales@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Approximation problem???
Date: Fri, 20 Nov 2009 16:42:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <he6gta$pll$1@fred.mathworks.com>
Reply-To: "Tales " <roztales@gmail.com>
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 1258735338 26293 172.30.248.35 (20 Nov 2009 16:42:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 20 Nov 2009 16:42:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2031151
Xref: news.mathworks.com comp.soft-sys.matlab:586745


Hi,

I am having a really weird problem that I cant find a reason. After a lot of calculation I was getting a wrong value for a variable, so I debbuged to find where was the problem, and I found a simple division mistake. A double h=0.0030 and another double hh=1/h . 
Of course hh is suposed to be 333.3333 but I am getting hh=333.8898
Here is the piece of code:

                h=str2double(cell2mat(raw(nameLinNum,densColumn)));
                hh=1/h;

Does anyone hava an idea on how to fix it???

Thanks