How to get only real output from (-3)^(1/3)
조회 수: 3 (최근 30일)
이전 댓글 표시
(-3)^(1/3)
I need the ans: -1.44224957.
댓글 수: 0
답변 (2개)
Steven Lord
2021년 8월 22일
You can use the nthroot function.
y = nthroot(-3, 3)
댓글 수: 2
Walter Roberson
2021년 8월 22일
... I went looking for that, as I thought I remembered it existing. It is not mentioned in the documentation for power() or realroot() .
Walter Roberson
2021년 8월 22일
format long g
syms x
solve(x^3==-3 & imag(x) == 0)
double(ans)
참고 항목
카테고리
Help Center 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!