Calculating sin and cos functions
조회 수: 465 (최근 30일)
이전 댓글 표시
Hello, i calculated the value of sin(45) in Matlab, the result was sin(45)=0.8509 and for cosin i got cos(45)= 0.5253. From general mathematics we know that sin(45)=cos(45) then why Matlab is giving different results??
댓글 수: 0
채택된 답변
Paulo Silva
2011년 5월 29일
Those functions work in radians not degrees, try this
cosd(45)
sind(45)
댓글 수: 3
Walter Roberson
2021년 12월 18일
It is not clear to me why sin() of a scalar should result in a vector of length 4 ? Or why those particular values should be output ?
추가 답변 (5개)
bym
2011년 5월 29일
sin() & cos() arguments are in radians. If you want degrees use
sind() cosd()
댓글 수: 3
Steven Lord
2020년 4월 20일
If you're going to convert degrees to radians or vice versa, use the deg2rad or rad2deg functions moved from Mapping Toolbox to MATLAB in release R2015b rather than the "magic number" of pi/180.
krishna sutradhar
2021년 6월 23일
편집: Walter Roberson
2021년 12월 18일
sin(2250 ) + cot(300 ) + tan-1 (1/2) + 10e-10 + 9x10-2 + (log1010)3 + (loge10)5
댓글 수: 2
Walter Roberson
2021년 12월 18일
sind(2250) + cotd(300) + atand(1/2) + 10e-10 + 9*10^-2 + log10(10)^3 + log(10)^5
Nishith Sarkar
2022년 6월 29일
편집: Nishith Sarkar
2022년 6월 29일
Question: sin(225) + cot(30) + tan-1(1/2) + 10e-10 + 9x10-2 + (log1010)3 + (loge10)5
>> ns1=sind(225)
ns1 =
-0.7071
>> ns2=cotd(30)
ns2 =
1.7321
>> ns3=atand(1/2)
ns3 =
26.5651
>> ns4=10e-10
ns4 =
1.0000e-09
>> ns5=9*10^-2
ns5 =
0.0900
>> ns6=log10(10)^3
ns6 =
1
>> ns7=log(10)^5
ns7 =
64.7260
>> Nishith=ns1+ns2+ns3+ns4+ns5+ns6+ns7
Nishith =
93.4059
Adedotun Taiwo
2022년 2월 14일
Cos(45)
댓글 수: 1
Walter Roberson
2022년 2월 14일
MATLAB is case sensitive. That would not work.
Cos(45)
Paulo correctly answered a decade ago that if you are using degrees, use sind() and cosd()
Nishith Sarkar
2022년 6월 29일
편집: Nishith Sarkar
2022년 6월 29일
Answer please::
x=3cos50π+10sin300π-cos100π
댓글 수: 2
Walter Roberson
2022년 6월 29일
편집: Walter Roberson
2022년 6월 29일
Pi = sym(pi);
x = 3*cos(50*Pi) + 10*sin(300*Pi) - cos(100*Pi)
Steven Lord
2022년 6월 29일
참고 항목
카테고리
Help Center 및 File Exchange에서 Trigonometry에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!