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

조회 수: 2 (최근 30일)
Nadine Nassar
Nadine Nassar 2019년 9월 21일
댓글: Nadine Nassar 2019년 9월 27일
  • 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

채택된 답변

Bruno Luong
Bruno Luong 2019년 9월 21일
Test wth "=="
if (y==0)

추가 답변 (1개)

카테고리

Help CenterFile Exchange에서 Argument Definitions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by