MATLAB: Should I use the absolute value of fast Fourier transform or the conjugate in signal analysis

MATLABsignal processing

I found this example in MATLAB https://www.mathworks.com/help/matlab/math/fft-for-spectral-analysis.html and I saw that they used the value of conjugate.
Pyy = Y.*conj(Y)/251;
I tried to calculate the magnitude using abs function rather than this line. I get nearly the same output.
Therefore, I am puzzled; should I use the way in this example or the magnitude way?

Best Answer

Note that the plot is ‘Power Spectral Density’. Power is the square of magnitude.
The abs value is the square root of the complex value times its conjugate.