My code is:

`function onex(y)cos(y)*cos(y)-sin(y)*sin(y)end`

When I insert y=pi/4 The result is:

`>> onex(pi/4)ans = 2.2204e-16`

Does anybody has any suggestions? Thank you in advance!

Skip to content# MATLAB: The answer is wrong ( SIMPLE TRIGONOMETRIC)

###### Related Question

functiontrigonometric

My code is:

`function onex(y)cos(y)*cos(y)-sin(y)*sin(y)end`

When I insert y=pi/4 The result is:

`>> onex(pi/4)ans = 2.2204e-16`

Does anybody has any suggestions? Thank you in advance!

- How toncrease the accuracy of trigonometric functions
- Plotting antenna field patterns in spherical coordinates
- Bug with cosd and sind functions
- Draw arc in Matlab
- Implementing mathematical functions in Matlab
- Plotting a given velocity field (vortex flow)
- Converting atan2 output to 360 deg
- Help on trigonometric operations using syms variable.

## Best Answer