MATLAB: Do I get the error message of using too many input argument when using the spectrogram function

input argumentsspectrogram

I am using the following code:
path2=['D:\Uni\0-SysMuWi\Masterthesis\Musikausschnitte_Hoertest2\Klavier+Gesang.wav']
[a,Fs] = audioread(path2);
W=256;
h=hanning(W);
b=[2 4 6 8];
Y=64:
spectrogram(path2,h,W/2,Y,Fs)
And I get the error message:
Error using spectrogram Too many input arguments.
Error in spectrum_numerated (line 52) spectrogram(b,hanning(W),W/2,Y,Fs)
I also used "b" instead of "path2" in the spectrogram function but I still get the same error message.

Best Answer

The current online documentation is for R2017a. If you have a different release (version), type
doc spectrogram
in your Command Window to display the documentation and examples for your version. Differences between versions could explain the error your code is throwing.