MATLAB绘图程序错误,出现最后一点与原点连接。
Afficher commentaires plus anciens
请教下列程序哪里出了错,导致原点出现一个点。
b=10;
a=zeros(1,10);
r=zeros(1,10);
Xe=zeros(1,10);
Ye=zeros(1,10);
Xe(1)=3;Ye(1)=2;
a(1)=2;r(1)=1;
z=2;
b1=b;
m=-1;
while m<=0
a(z)=z*2;
r(z)=r(z-1)+a(z);
Xe(z)=Xe(z-1)+r(z-1);
Ye(z)=Ye(z-1)+r(z-1);
z=z+1;
if b1-r(z-1)<=0
m=1;
end
end
plot(Xe,Ye,'--');
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 二维图和三维图 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!