Main Content


Inverse cotangent in radians



Y = acot(X) returns the Inverse Cotangent (cot-1) of the elements of X in radians. The function accepts both real and complex inputs.

  • For real values of X, acot(X) returns values in the interval [-π/2, π/2].

  • For complex values of X, acot(X) returns complex values.


collapse all

Find the inverse cotangent of a value.

ans = 0.3672

Find the inverse cotangent of the elements of vector x. The acot function acts on x element-wise.

x = [0.5i 1+3i -2.2+i];
Y = acot(x)
Y = 1×3 complex

   1.5708 - 0.5493i   0.1093 - 0.3059i  -0.3689 - 0.1506i

Plot the inverse cotangent function over the intervals -2πx<0 and 0<x2π.

x1 = -2*pi:pi/30:-0.1;
x2 = 0.1:pi/30:2*pi;
hold on
grid on

Input Arguments

collapse all

Cotangent of angle, specified as a scalar, vector, matrix, multidimensional array, table, or timetable. The acot operation is element-wise when X is nonscalar.

Data Types: single | double | table | timetable
Complex Number Support: Yes

More About

collapse all

Inverse Cotangent

The inverse cotangent is defined as


Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced before R2006a

expand all

See Also

| | |