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

7 ビュー (過去 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 件のコメント
Nadine Nassar
Nadine Nassar 2019 年 9 月 27 日
Thanks a lot!!

サインインしてコメントする。

その他の回答 (1 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by