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!