"The complex number is being squared and should result in a real answer with no complex part at all"
Huh? Certainly not. . You'll only get a real output if your input number is pure imaginary or pure real. So you can get complex numbers out of a square and as per Madhan's answer if you try to plot that, matlab will discard the imaginary part for the plot and warn you.
Now if the input to acos is pure real, then acos should return either a pure real or a pure complex number which when squared will be pure real, so it would seem that your input to acos is complex. You haven't supplied enough information for us to know why.
In any case, have you used the debugger to find out what is really happening with your code instead of what you think is happening?
Best Answer