Documentation Center

  • Trials
  • Product Updates


Real nth root of real numbers


y = nthroot(X, n)


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.


nthroot(-2, 3)

returns the real cube root of -2.

ans =


By comparison,


returns a complex cube root of -2.

ans =

   0.6300 + 1.0911i

See Also


Was this topic helpful?