Documentation Center

  • Trials
  • Product Updates

nthroot

Real nth root of real numbers

Syntax

y = nthroot(X, n)

Description

y = nthroot(X, n) returns the real nth root of the elements of X. Both X and n must be real and n must be a scalar. If X has negative entries, n must be an odd integer.

Examples

nthroot(-2, 3)

returns the real cube root of -2.

ans =

   -1.2599

By comparison,

(-2)^(1/3)

returns a complex cube root of -2.

ans =

   0.6300 + 1.0911i

See Also

|

Was this topic helpful?