I keep getting a 'parse error' at '='
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nadine Nassar
am 21 Sep. 2019
Kommentiert: Nadine Nassar
am 27 Sep. 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
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Argument Definitions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!