If you read the help for spectrogram you'll find this:
algorithm specified by SPECTRUMTYPE when computing the power spectral
SPECTRUMTYPE can be set to 'psd' or 'power':
'psd' - returns the power spectral density.
'power' - scales each estimate of the PSD by the equivalent noise
bandwidth of the window (in Hz). Use this option to
obtain an estimate of the power at each frequency.
The default value for SPECTRUMTYPE is 'psd'.
So just call spectrogram with its outputs and plot yourself:
[S,F,T,P] = spectrogram(your,inputs,sampling,frequency,and,window,etc);
You can then chose whether get power spectral density or power.