The result given by Matlab will be correct, assuming you have adopted the same sign conventions when setting up the analytic FT. In particular the antisymmetry of X results in imaginary x.
Also, this looks like a QM problem, and as far as I know there's no reason you can't have an imaginary...