I dont know where im going wrong with the code
1 次查看(过去 30 天)
显示 更早的评论
adj = 20; % ft
opp = 200; % ft
% pythagorus formula a^2+b^2=c^2
c^2 = adj^2+opp^2;
c^2 = sqrt(ans)
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Additional Math and Discrete 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!