Why do I get the error message of using too many input argument when using the spectrogram function?
古いコメントを表示
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.
採用された回答
その他の回答 (1 件)
The calling sequence is:
[s,f,t] = spectrogram(x,window,noverlap,f,fs)
x is the signal. I do noth think that the file name or "b" (what ever this mean exactly) is what you want. I'd expect a to be the first input.
I'm surprised that the code works at all, because this line should fail:
Y=64:
A trailing colon? Is this a typo in the forum? If yo, please post the code exactly how you run it.
3 件のコメント
Claudia Stirnat
2017 年 5 月 24 日
Jan
2017 年 5 月 24 日
No, there is no connection to the file name. Try to identify the problem by using the debugger:
dbstop if error
Now run the code again until it stops. Look in the editor and search in the surrounding lines. The function spectrogram is called with 5 inputs, which is actually allowed. But perhaps you call it with unexpected arguments? Try to run the code examples from the documentation then. Do they run? Then examine, what is the difference to you way to call it.
Claudia Stirnat
2017 年 5 月 24 日
編集済み: Claudia Stirnat
2017 年 5 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Time-Frequency Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!