Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab How to plot these figures?

  1. Jan 10, 2017 #1
    Dear group,

    I am new with matlab and trying to plot these figure out as the file request.

    I tried but could not get the same plot as the file has.

    I hope anyone can help. Here is the code which i am working on.

    Thank you.
    Code (Matlab M):

    fc = 553e6;
    w   = 0:2*pi*fc*1e-2:100*2*pi*fc;
    pau = 0.33;
    tau = 0.2e-9; % in nano second

    % beta_square = zeros(1,length(w));

    beta_square = 1 + 2*pau*cos(w*tau) + pau^2;
    theta  = atan(-pau*sin(w*tau)/(1+pau*cos(w*tau)));


    Attached Files:

    Last edited by a moderator: Jan 11, 2017
  2. jcsd
  3. Jan 11, 2017 #2


    Staff: Mentor

  4. Jan 11, 2017 #3

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    your beta_square is not in dB and the angle is not in degrees you will have to convert.

    Code (Text):
     theta  = atan(-pau*sin(w*tau)./(1+pau*cos(w*tau)));
    you need a ./ not just / for the division because w is a vector not a scalar.
  5. Jan 11, 2017 #4
    @Dr Transport: oh yeah, I missed that dot, that's why I received only scalar not a vector.
    Thank you, for the help.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted