How can I get MATLAB to calculate $(-1)^{1/3}$ as $-1$? Why is it giving me $0.5000 + 0.8660i$ as solution? I have same problem with $({-1\over0.1690})^{1/3}$ which should be negative.
2026-03-30 23:18:01.1774912681
Matlab wrong cube root
3.1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
In the following I'll assume that $n$ is odd, $n>2$, and $x<0$.
When asked for $\sqrt[n]{x}$, MATLAB will prefer to give you the principal root in the complex plane, which in this context will be a complex number in the first quadrant. MATLAB does this basically because the principal root is the most convenient one for finding all of the other complex roots.
You can dodge this issue entirely by taking $-\sqrt[n]{-x}$.
If you want to salvage what you have, then you'll find that the root you want on the negative real axis is $|z| \left ( \frac{z}{|z|} \right )^n$. Basically, this trick is finding a complex number with the same modulus as the root $z$ (since all the roots have the same modulus), but $n$ times the argument. This "undoes" the change in argument from taking the principal root.