MATLAB: Matlab calculates cosine different from the calculator

cos

If i calculate cos(1) in matlab I get ans=0.5403 whereas my calculator says 0.9998, what am I missing?

Best Answer

Your calculator is calculating in degrees. By default MATLAB calculates in radians:
MATLAB = cos(1)
Calculator = cosd(1)
produces:
MATLAB =
0.540302305868140
Calculator =
0.999847695156391
Use the MATLAB cosd function (and the other ā€˜dā€™ trigonometric functions) to calculate in degrees.
Related Question