How to get only real output from (-3)^(1/3)
4 ビュー (過去 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!