Navigation

Operators and Keywords

Function List:

C++ API

nthroot.m File Reference


Functions

 if (isscalar(x)) x *
endif if (isscalar(m)) m *
 if (any(idx(:))) y(idx)
endif if (all(imag(y)==0)) y
endif endfunction !assert (nthroot(-1,[3,-3]),[-1,-1], eps)
 !assert (nthroot([-1, 1],[3.1,-3]),[-1, 1].^(1./[3.1,-3]))
 !assert (nthroot([-1+1i,-1-1i], 3),[-1+1i,-1-1i].^(1/3))

Variables

function y
endif idx = (mod (m, 2) == 1 & imag (x) == 0 & x < 0)

Function Documentation

!assert ( nthroot([-1+1i,-1-1i], 3)  ,
[-1+1i,-1-1i] .^  1/3 
)

!assert ( nthroot([-1, 1],[3.1,-3])  ,
[-1, 1] .^  1./[3.1,-3] 
)

endif endfunction !assert ( nthroot(-1,[3,-3])  ,
eps   
)

endif if ( all(imag(y)==0)   ) 

if ( any(idx(:))   ) 

endif if ( isscalar(m)   ) 

if ( isscalar(x)   ) 


Variable Documentation

endif idx = (mod (m, 2) == 1 & imag (x) == 0 & x < 0)

endif y

Initial value:

 nthroot (x, m)

  if (nargin != 2)
    print_usage ()