Reputation: 12508
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
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