`psdx(2:end-1) = 2*psdx(2:end-1);`

I couldn't quite get why only the indices 2 to last but one is taken i.e, first and last indices are discarded.

It would be great if anyone could help me understand why this is being done.

Skip to content# MATLAB: Help in understanding the Power Spectral Density estimates using FFT

fftpower spectral densitySignal Processing Toolbox

`psdx(2:end-1) = 2*psdx(2:end-1);`

I couldn't quite get why only the indices 2 to last but one is taken i.e, first and last indices are discarded.

It would be great if anyone could help me understand why this is being done.

## Best Answer