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

1 visualizzazione (ultimi 30 giorni)
('x' has to be a positive value and 'a' has to entered in degrees then converted to radian)
  1 Commento
KSSV
KSSV il 15 Feb 2017
Modificato: KSSV il 15 Feb 2017
It is such simple....there is inbuilt function cos . Read about it.

Accedi per commentare.

Risposte (1)

Andres Yie
Andres Yie il 26 Mar 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.

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by