Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: problam evaluating a simple calculation for a vector of values
Date: Mon, 8 Dec 2008 13:48:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 10
Message-ID: <ghj8ih$7r8$1@fred.mathworks.com>
References: <ghj6ui$9m9$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1228744081 8040 172.30.248.38 (8 Dec 2008 13:48:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 8 Dec 2008 13:48:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:505594


"Arik g" <elalyg@gmail.com> wrote in message <ghj6ui$9m9$1@fred.mathworks.com>...
> i'm usin the Array multiply operator .* for a simple calculation on a vector of values.
> this is done by a for-loop, that runs around 5000 times. each run, the calculation includes several multiplications of values usually smaller than 1, with the values in the vector. threre is no interaction between the values, naturally. the thing is, that as the runs go forward, the values multipling the vector get   r e a l l y   s m a l l,   around 10^-100 or 10^-200, nearing the 10^-324 limit for the floating-double-array numbers in my PC.
> and now the strange thing: when the vector has 1, 2 or 3 values, the claculation results for those values is certain curve. when the vector has 4 or more values, the outcome changes and the same curves and results - corresponding to the values that were in the vector of size 1-3 - are now of different values, and are fluctuating in an increasung increment.
> i couldn't find any bug or divide-by-zero which wasn't avoided (although i'm not that experienced, so anything's possible) - so can anyone tell me what is the problem? is it in the machine, the program or a question of scaling the values in the calculation beforw outputing them?

Unless you show us an example, we cannot do
or say much to help you.

John