The warning means that you're trying to plot complex values on real axes.
I believe that it's not that line that triggers that warning, but rather a plot
command (or its similar) somewhere else in your code.
The result of FFT transforms is usually complex, so if you want to plot these values, use two plots: one for the magnitude and one for the phase (or one plot for the real part and one for the imaginary part, but this is far less common to do so). To obtain the magnitude use the abs
command.
Following your comment, instead of imshow(X)
try imshow(abs(X))
or imshow(real(X))
.