How do I find the base of a right angle triangle b=xcos(a) in matlab.

1 Ansicht (letzte 30 Tage)
Julie Wanjiru
Julie Wanjiru am 15 Feb. 2017
Kommentiert: Walter Roberson am 26 Mär. 2017
('x' has to be a positive value and 'a' has to entered in degrees then converted to radian)
  1 Kommentar
KSSV
KSSV am 15 Feb. 2017
Bearbeitet: KSSV am 15 Feb. 2017
It is such simple....there is inbuilt function cos . Read about it.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Andres Yie
Andres Yie am 26 Mär. 2017
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.

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by