From: Laurentiu on
Hey
Does anybody have any suggestions about how I could let MATLAB know that it should consider a number like 5.67*10^(-5) equal to 0, especially since, for example, all the other coefficients of the polynomial are of at least 10^(-2) order?

Thanks
From: Matt J on
"Laurentiu " <laurREMOVECAPSmarinovici(a)gmail.com> wrote in message <hrv9kp$cee$1(a)fred.mathworks.com>...
> Hey
> Does anybody have any suggestions about how I could let MATLAB know that it should consider a number like 5.67*10^(-5) equal to 0, especially since, for example, all the other coefficients of the polynomial are of at least 10^(-2) order?
======

coefficients(coefficients<=5.67*10^(-5)) = 0;
From: TideMan on
On May 7, 8:43 am, "Laurentiu " <laurREMOVECAPSmarinov...(a)gmail.com>
wrote:
> Hey
> Does anybody have any suggestions about how I could let MATLAB know that it should consider a number like 5.67*10^(-5) equal to 0, especially since, for example, all the other coefficients of the polynomial are of at least 10^(-2) order?
>
> Thanks

Beware of setting the coefficients of a polynomial to zero just
because you think they are too small.
For example, say the coefficient of x^3 is 5e-5, while all the others
are of order 1e-2.
If you evaluate the polynomial in the range from -10 to 10, then sure
the x^3 contribution is small.
But if you evaluate it at x=200, the cubic term will have the same
order as the quadratic term.
From: Laurentiu on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hrva2c$aq8$1(a)fred.mathworks.com>...
> "Laurentiu " <laurREMOVECAPSmarinovici(a)gmail.com> wrote in message <hrv9kp$cee$1(a)fred.mathworks.com>...
> > Hey
> > Does anybody have any suggestions about how I could let MATLAB know that it should consider a number like 5.67*10^(-5) equal to 0, especially since, for example, all the other coefficients of the polynomial are of at least 10^(-2) order?
> ======
>
> coefficients(coefficients<=5.67*10^(-5)) = 0;

Well, that's a good suggestion. But, I was giving that number just as an example. The real thing that I do is computing some coefficients in a loop using another MATLAB function, and the small values appear randomly, so basically, I cannot quite know their values so that I could test them. Besides I would like to continue my computations with them being null automatically.
My idea would be to set up a tolerance in the beginning of the M file. But don't know how to let MATLAB know it should use that tolerance for computations.
Hope I am clearer now.
Thanks for the suggestion.
From: Laurentiu on
TideMan <mulgor(a)gmail.com> wrote in message <b39fb699-93cc-493c-92ce-5764ab476fe5(a)p2g2000yqh.googlegroups.com>...
> On May 7, 8:43 am, "Laurentiu " <laurREMOVECAPSmarinov...(a)gmail.com>
> wrote:
> > Hey
> > Does anybody have any suggestions about how I could let MATLAB know that it should consider a number like 5.67*10^(-5) equal to 0, especially since, for example, all the other coefficients of the polynomial are of at least 10^(-2) order?
> >
> > Thanks
>
> Beware of setting the coefficients of a polynomial to zero just
> because you think they are too small.
> For example, say the coefficient of x^3 is 5e-5, while all the others
> are of order 1e-2.
> If you evaluate the polynomial in the range from -10 to 10, then sure
> the x^3 contribution is small.
> But if you evaluate it at x=200, the cubic term will have the same
> order as the quadratic term.

Of course, I agree with you on that one.
In my case, the smallest coefficients turn out to be the ones for x^0, so instead of having a zero root, I get some very small number. one example : 0.02202 z^4 + 0.04014 z^3 + 0.01426 z^2 - 0.003851 z + 6.895e-010