mangesh
mangesh

Reputation: 61

SCILAB undefined vairable error when using 'polarplot'

I am getting the following error while running polarplot in scilab

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

result:

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

Upvotes: 0

Views: 401

Answers (2)

Foad S. Farimani
Foad S. Farimani

Reputation: 14016

As indicated by the other user as well the polarplot function requires at least two input vectors, like most of other plotting functions. It this case you probably want something like:

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

which yields:

enter image description here

Upvotes: 1

user5694329
user5694329

Reputation: 412

The polarplot function requires at least 2 input arguments theta and rho, In your example you forgot to give the evolution of the radius. for example:

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

Upvotes: 1

Related Questions