I keep getting a 'parse error' at '='

2 visualizaciones (últimos 30 días)
Nadine Nassar
Nadine Nassar el 21 de Sept. de 2019
Comentada: Nadine Nassar el 27 de Sept. de 2019
  • All my equal signs are underligned saying that there's a parse error, can someone help me with this?
function [r,theta] = polar_coordinates(x,y)
r = sqrt ((x^2)+(y^2))
if(x>0)
theta = arctan(x/y)
end
if (x<0)
if (y>0)
theta = arctan(x/y) + pi
if (y<0)
theta = arctan(x/y) - pi
if (y=0)
theta = pi
end
end
end
end

Respuesta aceptada

Bruno Luong
Bruno Luong el 21 de Sept. de 2019
Test wth "=="
if (y==0)

Más respuestas (1)

Categorías

Más información sobre Argument Definitions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by