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 个)

Andres Yie
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.

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by