MATLAB Function Reference    
tan, tanh

Tangent and hyperbolic tangent

Syntax

Description

The tan and tanh functions operate element-wise on arrays. The functions' domains and ranges include complex values. All angles are in radians.

Y = tan(X) returns the circular tangent of each element of X.

Y = tanh(X) returns the hyperbolic tangent of each element of X.

Examples

Graph the tangent function over the domain and the hyperbolic tangent function over the domain

The expression tan(pi/2) does not evaluate as infinite but as the reciprocal of the floating point accuracy eps since pi is only a floating-point approximation to the exact value of .

Algorithm

See Also

atan, atan2


 symvar  tempdir