Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

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.

Example

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

power

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS