Question based on scaling the FFT for obtaining PSD
The exact location (index) of the Nyquist frequency in your frequency vector depends on the length of the input signal. If the length is odd the Nyquist frequency is not included; if the length is even it is included. Consequently, and assuming the signal is real, either the first $\frac{N}{2}$ or $ \frac{N}{2} + 1$ samples are needed to fully describe your signal in the frequency domain. Note that, like the first sample describing the DC value, the sample describing the Nyquist value only occurs once; it should therefore not be multiplied by two when calculating the PSD of a real signal.

The proper scaling value to be used depends on the exact definition of the DFT. I have not checked MATLAB’s definition but if you want to make sure that the used scaling factor is correct use Parseval’s theorem. Check if the signal power in the time and frequency domain are identical; if not adjust the scaling factor accordingly.