Skip to Main Content Skip to Search
Product Documentation

cos - Cosine of argument in radians

Syntax

Y = cos(X)

Description

Y = cos(X) returns the cosine for each element of X. The cos function operates element-wise on arrays. All angles are in radians.

Definitions

The cosine of an angle is:

For complex values, cosine is:

Examples

Graph the cosine function over the domain :

x = -pi:0.01:pi; 
plot(x,cos(x)), grid on

See Also

acos | acosd | cosd | cosh

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS