I dont know where im going wrong with the code

1 回表示 (過去 30 日間)
Daniel Martelli
Daniel Martelli 2020 年 8 月 11 日
コメント済み: Daniel Martelli 2020 年 8 月 11 日
adj = 20; % ft
opp = 200; % ft
% pythagorus formula a^2+b^2=c^2
c^2 = adj^2+opp^2;
c^2 = sqrt(ans)

採用された回答

Sudheer Bhimireddy
Sudheer Bhimireddy 2020 年 8 月 11 日
The left-hand side should be the variable alone. Change that to
c = sqrt(adj^2 + opp^2)
c^2 cannot be the variable name as it has mathematical operator, on the other hand, c2 is a valid variable name.
  2 件のコメント
Daniel Martelli
Daniel Martelli 2020 年 8 月 11 日
thankyou
Daniel Martelli
Daniel Martelli 2020 年 8 月 11 日
i fixed it and it worked so thankyou

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by