Sujit Agarwal
Sujit Agarwal

Reputation: 12508

Difference between plot and polar in matlab

I've just started learning MATLAB, and the first thing i tried is to plot a spiral, I found two algorithms on searching,

PROGRAM 1 -

t = [0:0.1:(100*pi)];
t=sqrt(t);
r=2*t;
polar(t,r);

PROGRAM 2

t = linspace(0,100*pi,1000);
x = t.*cos(t);
y = t.*sin(t);
plot(x,y)

Both are working fine, but i would like to to know the basic difference between the plot() and polar() functions...

Upvotes: 1

Views: 1044

Answers (2)

DukeOfMarmalade
DukeOfMarmalade

Reputation: 2788

The polar() function as far as I know it does a polar co-ordinate plot, compared to a cartesian co-ordinate plot from plot(). Your spiral should look pretty similar which ever one you use.

Upvotes: 0

Dang Khoa
Dang Khoa

Reputation: 5823

plot plots in the Cartesian coordinate system; polar plots in the polar one.

A quick search through the documentation or Google would make made this pretty obvious.

Upvotes: 3

Related Questions