one script two anonymous functions
이전 댓글 표시


I do not undestand when I wrong in my code
thank you so much for yor help
ThirdSide = @(a,b,C) sqrt(a^2+b^2-(2*a*b*cos(C)));
TriangleArea = @(a,b,C) ((a*b)/2)*sin(C);
SideC =ThirdSide(5,8,50*pi/180)
AreaABC=TriangleArea(5,8,50*pi/180)
답변 (2개)
Steven Lord
2020년 10월 13일
1 개 추천
Based on the problem description I'm guessing C is an angle in degrees, not radians. If that's the case take a look at the sind function.
ThirdSide=@(a,b,C) sqrt(a^2+b^2-2*a*b*cos(C*pi/180))
TriangleArea=@(a,b,C) (((a*b)/2)*sin(C*pi/180))
SideC=ThirdSide(5,8,50)
AreaABC=TriangleArea(5,8,50)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!