[Solved] tan function giving incorrect values in matlab [closed]


It seems like you provide the argument to tan in degrees. However, Matlab expects its input in radians.

Try:

>> tan( pi / 4 )

If you insist on using degrees, you’ll find tand useful:

>> tand( 45 )

Remember rad = deg * pi / 180

solved tan function giving incorrect values in matlab [closed]