Help with Matlab.  DSP
This is a discussion on Help with Matlab.  DSP ; 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 ...

Help with Matlab.
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.0e015 * 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 ???

Re: Help with Matlab.
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.0e015 * 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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Re: Help with Matlab.
Hello nomee97,
Maybe the formating for the vetor and the individual values is different.
I don't remember the exact command, but there's a command to print the
"full" number without rounding.
Try "lookfor format" or something like that. Switch on all digits. I'm sure
1.0e15 is also in the individuals.
Wolfgang
"nomee97" <nomi97et@hotmail.com> schrieb im Newsbeitrag
news:1187593846.505472.265030@k79g2000hse.googlegroups.com...
>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.0e015 * 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 ???
>

Re: Help with Matlab.
On Aug 20, 3:55 pm, "Greg" <G...@nospam.ca> wrote:
> Hello nomee97,
>
> Maybe the formating for the vetor and the individual values is different.
> I don't remember the exact command, but there's a command to print the
> "full" number without rounding.
> Try "lookfor format" or something like that. Switch on all digits. I'm sure
> 1.0e15 is also in the individuals.
>
> Wolfgang
>
> "nomee97" <nomi9...@hotmail.com> schrieb im Newsbeitragnews:1187593846.505472.265030@k79g2000hse.googlegroups.com...
>
>
>
> >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.0e015 * 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 ??? Hide quoted text 
>
>  Show quoted text 
yes I got it thanks a lot,,
The problem was exactly as you described.

Re: Help with Matlab.
On Aug 20, 10:13 am, nomee97 <nomi9...@hotmail.com> wrote:
> On Aug 20, 3:55 pm, "Greg" <G...@nospam.ca> wrote:
>
>
>
> > Hello nomee97,
>
> > Maybe the formating for the vetor and the individual values is different.
> > I don't remember the exact command, but there's a command to print the
> > "full" number without rounding.
> > Try "lookfor format" or something like that. Switch on all digits. I'm sure
> > 1.0e15 is also in the individuals.
>
> > Wolfgang
>
> > "nomee97" <nomi9...@hotmail.com> schrieb im Newsbeitragnews:1187593846.505472.265030@k79g2000hse.googlegroups.com...
>
> > >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.0e015 * 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 ??? Hide quoted text 
>
> >  Show quoted text 
>
> yes I got it thanks a lot,,
>
> The problem was exactly as you described.
When matlab displays a complex number which have vastly different
exponents e.g. 5.44e15 +j*5.44e15 then the smaller one tends to
display as zero. Matlab tends to try to find 1 exponential value which
works for all the numbers in a vector/matrix  it can't always find
one.
You can use "format long" to get more decimal places in the display
and "format short" to go back to the default.
Cheers,
Dave
Similar Threads

By Application Development in forum labview
Replies: 1
Last Post: 12042007, 05:10 PM

By Application Development in forum labview
Replies: 0
Last Post: 11152007, 05:40 AM

By Application Development in forum DSP
Replies: 6
Last Post: 10062007, 11:11 PM

By Application Development in forum DSP
Replies: 2
Last Post: 08042007, 05:05 PM

By Application Development in forum Fortran
Replies: 1
Last Post: 07072007, 06:45 AM