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

조회 수: 1 (최근 30일)
Julie Wanjiru
Julie Wanjiru 2017년 2월 15일
댓글: Walter Roberson 2017년 3월 26일
('x' has to be a positive value and 'a' has to entered in degrees then converted to radian)
  댓글 수: 1
KSSV
KSSV 2017년 2월 15일
편집: KSSV 2017년 2월 15일
It is such simple....there is inbuilt function cos . Read about it.

댓글을 달려면 로그인하십시오.

답변 (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.
  댓글 수: 1
Walter Roberson
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 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