N -th root
This functionality does not run in MATLAB.
For a complex number x and integer n, surd(x, n) returns the n-th root of x whose (complex) argument is closest to that of x.
If x is a positive real number, surd(x, n) coincides with x^(1/n). If x is a negative real number and n is odd, then surd(x, n) coincides with -|x|^(1/n).
surd(x, n) returns that complex solution y of yn = x with polar angle closest to that of x; among two equally distant y's, the one with smaller argument is chosen. In contrast, x^(1/n) represents the solution with the smallest absolute value of the polar angle in the range .
If n is a numerical value, it must be a non-zero integer. If it is symbolic, it is understood to represent a non-zero integer.
surd(x, 2) is mathematically equivalent to sqrt(x). Unlike sqrt, however, surd may return an unevaluated symbolic call.
When called with a floating-point argument, the function is sensitive to the environment variable DIGITS which determines the numerical working precision.
If n is odd and x is real, then surd(x, n) is real, too. On the other hand, x^(1/n) is not real if x is negative:
surd(-27, 3), surd(-27.0, 3), (-27)^(1/3), (-27.0)^(1/3)
surd may be called with symbolic arguments:
Sometimes, surd returns an unevaluated function call:
surd(x, 3), surd(x, n^2 + n)