How do I find the base of a right angle triangle b=xcos(a) in matlab.
1 次查看(过去 30 天)
显示 更早的评论
('x' has to be a positive value and 'a' has to entered in degrees then converted to radian)
1 个评论
回答(1 个)
Andres Yie
2017-3-26
Use the comands:
a = input('Enter a in radians')
x = input('Enter x')
a = rad2deg(a) %Converts to degrees
b = x*cosd(a);
Also you can skip the radinas and use the cos() function that accepts the argument in radians.
1 个评论
Walter Roberson
2017-3-26
I think the intent was more
a = input('Enter a in degrees');
x = input('Enter x');
b = x*cosd(a);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!