plot作图问题。

8 vues (au cours des 30 derniers jours)
果博东方开户账号【微8785092】
n=8;k1=200;k2=500;
for i=1:n
plot([cos((i-1)*pi/n),-cos((i-1)*pi/n)],...
[sin((i-1)*pi/n),-sin((i-1)*pi/n)],'k-','LineWidth','2');
end
这种语法提示,plot不是数值标量,请问该怎么解决?

Réponse acceptée

果博东方游戏网址【微8785092】
因为LineWidth参数值为数字2,不是字符2
plot([cos((i-1)*pi/n),-cos((i-1)*pi/n)],...
[sin((i-1)*pi/n),-sin((i-1)*pi/n)],'k-','LineWidth',2);

Plus de réponses (0)

Catégories

En savoir plus sur 二维图和三维图 dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!