I am not certain what you want.
Getting information from the spectrogram function is clearly explained in the documentation: Spectrogram and Instantaneous Frequency (link).
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!