How can create a .wav bar based spectrogram on matlab?
You can get the bar based spectrogram by decomposing the signal segments into fractional-octave subbands. Try octaveFilterBank and then compute signal power level by pow2db(sum(abs(signal))). This will result in a logarithmic frequency scale.
You can also use pwelch to estimate power spectral density, which brings you a linear frequency scale.