MATLAB对角度从0到360度画出极坐标图

程序如下:
for u=0:0.01:1
p(1)=1;
t(1)=u;
p(2)=3*u;
t(2)=3*cos(2*acos(u));
for n1=3:11,
p1=(2*n1-1)./(n1-1).*p(n1-1).*u;
p2=n1./(n1-1).*p(n1-2);
p(n1)=p1-p2;
t1=n1*u.*p(n1);
t2=(n1+1).*p(n1-1);
t(n1)=t1-t2;
end;
end
subplot(2,1,1),polar(acos(u)*pi/180,p);
subplot(2,1,2),polar(acos(u)*pi/180,t);
u是cos角度的值,报错是
Error using polar (line 61)
THETA and RHO must be the same size.

Error in PTtu (line 33)
subplot(2,1,1),polar(acos(u)*pi/180,p);
急求,在线等

clc;clear all
for u=0:0.1:1
p(1)=1; 
t(1)=u;
p(2)=3*u; 
t(2)=3*cos(2*acos(u));
for n1=3:11
    p1=(2*n1-1)./(n1-1).*p(n1-1).*u;
    p2=n1./(n1-1).*p(n1-2);
    p(n1)=p1-p2;
    t1=n1*u.*p(n1);
    t2=(n1+1).*p(n1-1);
    t(n1)=t1-t2;
end;
end
u=0:0.1:1;
length(u)
length(p)
length(t)
subplot(2,1,1),polar(acos(u),p);
subplot(2,1,2),polar(acos(u),t);

温馨提示:答案为网友推荐,仅供参考