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 ...

+ Reply to Thread
Results 1 to 5 of 5

Help with Matlab.

  1. Default 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.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 ???


  2. Default 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.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.
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

  3. Default 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.0e-15 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.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 ???
    >




  4. Default 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.0e-15 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.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 ???- Hide quoted text -

    >
    > - Show quoted text -


    yes I got it thanks a lot,,

    The problem was exactly as you described.


  5. Default 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.0e-15 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.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 ???- 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.44e-15 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



+ Reply to Thread

Similar Threads

  1. can't run matlab setup/No puedo correr matlab
    By Application Development in forum labview
    Replies: 1
    Last Post: 12-04-2007, 05:10 PM
  2. Replies: 0
    Last Post: 11-15-2007, 05:40 AM
  3. matlab
    By Application Development in forum DSP
    Replies: 6
    Last Post: 10-06-2007, 11:11 PM
  4. Matlab fft and Intel MKL
    By Application Development in forum DSP
    Replies: 2
    Last Post: 08-04-2007, 05:05 PM
  5. Replies: 1
    Last Post: 07-07-2007, 06:45 AM