+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Junior Member level 2
    Points: 832, Level: 6

    Join Date
    Mar 2009
    Posts
    20
    Helped
    1 / 1
    Points
    832
    Level
    6

    MATLAB

    HOW TO PLOT COMPLEX VALUES IN MATLAB

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 4
    Points: 15,648, Level: 30
    Aya2002's Avatar
    Join Date
    Dec 2006
    Location
    Iraq
    Posts
    1,142
    Helped
    408 / 408
    Points
    15,648
    Level
    30

    MATLAB

    explain more, give an example, where you can convert to polar and plot it or others .
    just give me your equation.



  3. #3
    Junior Member level 2
    Points: 832, Level: 6

    Join Date
    Mar 2009
    Posts
    20
    Helped
    1 / 1
    Points
    832
    Level
    6

    Re: MATLAB

    I want to plot the graph for exp(-j*x) wrt to x



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 4
    Points: 15,648, Level: 30
    Aya2002's Avatar
    Join Date
    Dec 2006
    Location
    Iraq
    Posts
    1,142
    Helped
    408 / 408
    Points
    15,648
    Level
    30

    Re: MATLAB

    In polar Plot:

    just convert your equation to polar form before any programming

    x=0:pi/100:2*pi;
    r=abs(exp(-i*x));
    the=angle(exp(-i*x));
    polar(the,r)



    now if you want to plot it directly, the imaginary part will be ignored as below

    x=0:pi/100:2*pi;
    y=exp(-i*x);
    plot(x,y)
    Warning: Imaginary parts of complex X and/or Y arguments ignored
    >>


    best regards



  5. #5
    Full Member level 4
    Points: 1,738, Level: 9
    W_Heisenberg's Avatar
    Join Date
    Feb 2011
    Location
    Boston
    Posts
    217
    Helped
    5 / 5
    Points
    1,738
    Level
    9

    Re: MATLAB

    Quote Originally Posted by Aya2002 View Post
    In polar Plot:

    just convert your equation to polar form before any programming

    x=0:pi/100:2*pi;
    r=abs(exp(-i*x));
    the=angle(exp(-i*x));
    polar(the,r)



    now if you want to plot it directly, the imaginary part will be ignored as below

    x=0:pi/100:2*pi;
    y=exp(-i*x);
    plot(x,y)
    Warning: Imaginary parts of complex X and/or Y arguments ignored
    >>


    best regards

    how about 2D exponetial graph?

    say x[n1,n2]=exp(j*(w1*n1+w2*n2))

    how to draw the x wrt n1 and n2?
    Every word or concept, clear as it may seem to be, has only a limited range of applicability.



    •   AltAdvertisement

        
       

  6. #6
    Advanced Member level 1
    Points: 3,785, Level: 14
    Achievements:
    7 years registered

    Join Date
    Jan 2008
    Posts
    435
    Helped
    92 / 92
    Points
    3,785
    Level
    14

    Re: HOW TO PLOT COMPLEX VALUES IN MATLAB ?

    I think this isn't possible. You need two axis to plot x (one for the real part and one for the imaginary part - or the magnitude and the phase) and you need one axis for n1 and one for n2. Thus, you need four axis to plot, but we have only three.

    You can create two 3d-plots: one with the real part of x versus n1 and n2 and one with the imaginary part of x versus n1 and n2.
    Or you can use the magnitude and phase instead of the real and imaginary part, this depends on your needs.



  7. #7
    Full Member level 4
    Points: 1,738, Level: 9
    W_Heisenberg's Avatar
    Join Date
    Feb 2011
    Location
    Boston
    Posts
    217
    Helped
    5 / 5
    Points
    1,738
    Level
    9

    Re: HOW TO PLOT COMPLEX VALUES IN MATLAB ?

    oh, i see. i think it is impossible too.

    - - - Updated - - -

    oh, i see. i think it is impossible too.
    Every word or concept, clear as it may seem to be, has only a limited range of applicability.



--[[ ]]--