matlab calculates cosine different from my calculator

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

Accepted Answer

Star Strider
Star Strider on 8 Apr 2020
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.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!