Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: IncoHerences in MATLAB Date: Fri, 12 Dec 2008 23:24:01 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 42 Message-ID: <ghurqh$7nu$1@fred.mathworks.com> References: <ghs86t$528$1@fred.mathworks.com> <cfb60b8d-f7ec-4606-a52f-60fa9dd60c33@r15g2000prh.googlegroups.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 1229124241 7934 172.30.248.38 (12 Dec 2008 23:24:01 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Fri, 12 Dec 2008 23:24:01 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1637974 Xref: news.mathworks.com comp.soft-sys.matlab:506665 NZTideMan <mulgor@gmail.com> wrote in message <cfb60b8d-f7ec-4606-a52f-60fa9dd60c33@r15g2000prh.googlegroups.com>... > On Dec 12, 12:37=A0pm, "Trouble Finders Costa" > <valencada...@hotmail.com> wrote: > > I have discovered some incoerences and troubles in some commands of MATLA= > B. These problems caused me headaches by the time I have faced them for the= > first time, because of the loss of several minutes in work until the perce= > ption of the problem. > > > > One of this problems, an incoerence, is: try if [125000:125000:10/0.00001= > ] and [125000:125000:1000000] are vectors of the same dimension when genera= > ted in MATLAB. > > > > Another problem, a trouble, has to do with the question of numerical prec= > ision. Try the following commands: > > time =3D 0; time_increment =3D 0.01; n =3D (a number of your choice); > > for i =3D 1:n > > =A0 =A0 time =3D time =A0+ time_increment; > > end > > > > You will notice that, for large values of "n", some decimal numbers will = > appear after the second one. This shouldn't happen. I have observed this pr= > oblem for values of "time_increment" less than 0.1 > > > > Thank you for your attention. > > > > Dante Valen?a. > > What do you mean by "incoerence"? You've written it 3 times, so it > cannot be a spelling mistake, but it is not an English word. I > suspect it is a malapropism, but I'm not sure which word you're > getting at. > "incoherence", means a nonsense, but the fact that 10/0.00001 is not > the same as 1000000 in floating point arithmetic is not a nonsense. > The principle is well known and has been commented on many times in > this forum. > > That these matters cause you headaches is a shame, but perhaps they > would cause you less concern if you learned from your mistakes and in > future refrained from trying to use floating point numbers as if they > were integers. Thank you. I was having in mind the word "incoer?ncia" when I wrote "incoerence". I will try to improve my English, it's not my first language. Is it yours?