MATLAB Answers


How to plot a function like this in matlab

Asked by maharaj
on 1 Feb 2013


here t varies from -pi to pi x is a constant like for example 0.1

  1 Comment

Log in to comment.

2 Answers

Answer by Jan Simon
on 1 Feb 2013

What about:

x = 0.1;
t = linspace(-pi, pi, 200);
p = 0.5 * (1 - x.^2) ./ ((1 + x.^2 - 2 .* x .* cos(t)).^(3/2));
plot(t, p);

Such methdos are explained exhaustively in the Getting Started chapters of the documentation and help plot offer detailed information also.


Log in to comment.

Answer by Wayne King
on 1 Feb 2013

   x = 0.1;
   t = -pi:.01:pi;

I'm guessing you really mean plot p as a function of t


Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!