Como puedo graficar en polar?

1 view (last 30 days)
Cristhian Guano
Cristhian Guano on 16 Feb 2017
Commented: mizuki on 16 Feb 2017
Tengo la siguiente funcion
if true
function curvas_polares()
theta=linspace(-pi,pi,100);
rho=2-4.*cos(theta);
comet(polar(theta,rho));
end
Y en la ventana de comandos me aparece el siguiente error:
if true
Undefined function 'isfinite' for input arguments of
type 'matlab.graphics.chart.primitive.Line'.
Error in comet>minmax (line 109)
minx = min(x(isfinite(x)));
Error in comet (line 40)
[miny,maxy] = minmax(y);
Error in curvas_polares (line 4)
comet(polar(theta,rho));
end
Agradeceria si alguien me ayuda con una solucion
  1 Comment
mizuki
mizuki on 16 Feb 2017
Que version de MATLAB usas? Ejecuto el codigo en ambos R2010b y R2016b, pero funciono bien.
En tu codigo, incluyes "if true" tambien? Entonces, no puedes definir el funcion en "if"-declaracion. Definir el funcion por separado, por ejemplo:
function curvas_polares()
theta=linspace(-pi,pi,100);
rho=2-4.*cos(theta);
comet(polar(theta,rho));
end
y
if true
curvas_polares()
end

Sign in to comment.

Answers (0)

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!