angle
Symbolic polar angle
Syntax
Description
Examples
Compute Polar Angle of Numeric Inputs
Compute the polar angles of these complex numbers. Because these numbers are not symbolic objects, you get floating-point results.
[angle(1 + i), angle(4 + pi*i), angle(Inf + Inf*i)]
ans = 0.7854 0.6658 0.7854
Compute Polar Angle of Symbolic Inputs
Compute the polar angles of these complex numbers which are converted to symbolic objects:
[angle(sym(1) + i), angle(sym(4) + sym(pi)*i), angle(Inf + sym(Inf)*i)]
ans = [ pi/4, atan(pi/4), pi/4]
Compute Polar Angle of Symbolic Expressions
Compute the limits of these symbolic expressions:
syms x limit(angle(x + x^2*i/(1 + x)), x, -Inf) limit(angle(x + x^2*i/(1 + x)), x, Inf)
ans = -(3*pi)/4 ans = pi/4
Compute Polar Angle of Array
Compute the polar angles of the elements of matrix
Z
:
Z = sym([sqrt(3) + 3*i, 3 + sqrt(3)*i; 1 + i, i]); angle(Z)
ans = [ pi/3, pi/6] [ pi/4, pi/2]
Input Arguments
Tips
Calling
angle
for numbers (or vectors or matrices of numbers) that are not symbolic objects invokes the MATLAB®angle
function.If
Z = 0
, thenangle(Z)
returns0
.
Alternatives
For real X
and Y
such that Z = X +
Y*i
, the call angle(Z)
is equivalent to
atan2(Y,X)
.
Version History
Introduced in R2013a