x = y.^1/3
MATLAB would parse that as being x = (y.^1)/3 which is x = y/3 which is not what you want.
If you were to use x = y.^(1/3) then that would be closer. However, you would encounter the problem that P.^Q is defined as being equivalent to exp(Q*log(P)) -- and log() of a negative number is complex, so if the power Q is not an even integer, the result is going to be complex.