MATLAB: How to fix the following error

frequencyspectrogram

dear Seniors and Experts I need solution for following code kindly help me to fix it .
data is
y=195840*2 double
fs=48000
t=0:0.001:2; % 2 secs @ 1kHz sample rate
x=chirp(t,0,1,150); % Start @ DC, cross 150Hz at t=1sec
F = 0:.1:100;
[y,f,t,p] = spectrogram(x,256,250,F,1E3,'yaxis');
% NOTE: This is the same as calling SPECTROGRAM with no outputs.
surf(t,f,10*log10(abs(p)),'EdgeColor','none');
axis xy; axis tight; colormap(jet); view(0,90);
xlabel('Time');
ylabel('Frequency (Hz)');
[y,fs]=audioread('Mithe Mustafa Tey 5sec.mp3');
NW = round(fs*0.250);
[S,F,T,P] = spectrogram(y,NW,[],[],fs);
Error using spectrogram>chkinput (line 252)
X must be a vector (either row or column).
Error in spectrogram (line 166)
chkinput(x);
while I click on line 252 and 166 it shows this
line 252 = error(message('signal:spectrogram:MustBeVector', 'X'));
line 166 = chkinput(x);

Best Answer

Thanks Dear walter If I wish to plot both channels then how to do that?
Related Question