Is there Matlab code that shows a series of numbers representing a waveform as a spectrogram?
The time interval each sample represents is the same, idearly this could also be given to use for the axis scale.

For example:
spec({1 2 3 2 1 2 3 2}, 0.1 seconds)
or
spec(my_data.txt, 10 Hz)
etc…
If you have the Signal Processing Toolbox, then you can use the
spectrogram()function. e.g.:(Example taken from that documentation page.)
The numeric params are window length, overlap length, FFT length and sampling frequency, respectively.