使用'polarplot'时SCILAB未定义可修改错误

问题描述 投票:0回答:2

我在scilab中运行polarplot时出现以下错误

// Program to plot using polarplot function
t= 0:.01:2*%pi;
polarplot(sin(t))
xtitle('Using polarplot'

结果:

exec('D:\mangesh\SCILAB PROJ\sample\polarplot.sce', -1)
at line    13 of function polarplot ( C:\PROGRA~1\SCILAB~1.1\modules\graphics\macros\polarplot.sci line 25 )
at line 3 of executed file D:\mangesh\SCILAB PROJ\sample\polarplot.sce

Undefined variable: rho
plot scilab
2个回答
1
投票

polarplot函数需要至少2个输入参数theta和rho。在你的例子中,你忘了给出半径的演变。例如:

   polarplot(sin(t), ones(t))

1
投票

正如其他用户所指出的那样,polarplot函数需要至少两个输入向量,就像大多数其他绘图函数一样。在这种情况下,您可能需要以下内容:

// Program to plot using polarplot function
t = 0:.01:2*%pi;
polarplot(t, sin(t));
xtitle('Using polarplot');

产量:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.