nomee97 wrote:

> I have a very strange problem with Matlab,

>

> I have a vector which has some complex values for example 1.4142 +

> 0.0000i , all values have imaginary part equal to 0.0000i . when I

> take imag() or angle() of this vector i do not get zero , instead I

> get some value like 1.0e-015 * -0.1110 . If I take imag() or angle()

> of the individual value ans is 0.

>

> Why I am not getting the answer = 0 for the whole vector ???

Welcome to the real world. If the imaginary part of your result plotted

an inch long, how long would the real part be? If the real part plotted

a foot long, wow long would the imaginary part be?

Computers don't deal with numbers; they deal with bits. After several

operations, it is reasonable to expect total roundoff errors of two or

three bits. how much accuracy do you expect?

Jerry

--

Engineering is the art of making what you want from things you can get.

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯