why my code run in online matlab, and in app has an error?

3 次查看(过去 30 天)
I have a simple code with function "detectspeech" (see button) but in my pc app (version R2023a) don't work (in online version yes), give me this error:
"Error using gather
Too many input arguments.
Error in detectSpeech (line 88)
[fs,varargin{:}] = gather(fs,varargin{:});
Error in teste_detetar_fala (line 18)
Anyone know to solve this problem or why this hapenning?
windowDuration = 0.074; % seconds
numWindowSamples = round(windowDuration*fs);
win = hamming(numWindowSamples,'periodic');
percentOverlap = 35;
overlap = round(numWindowSamples*percentOverlap/100);
mergeDuration = 0.44;
mergeDist = round(mergeDuration*fs);
Thanks for your attention.
Felipe L. Teixeira
  5 个评论



Walter Roberson
Walter Roberson 2023-7-16
It looks like a bug in the detectSpeech code for R2023a if you call detectSpeech with more than one parameter.
That section of the code was reworked a fair bit for R2023b beta

更多回答(2 个)

Harsh Kumar
Harsh Kumar 2023-7-14
编辑:Harsh Kumar 2023-7-19
Hi Felipe ,
I understand that you are facing an error while running a code in MATLAB App which runs fine in MATLAB online .
It is happening because MATLAB online has all packages preinstalled in cloud .Since , you are using 'audioread ' function you will need to install the neccesary toolboxes like 'Audio System Toolbox' and 'Signal Processing Toolbox' before using it.
Follow the given steps to install the toolbox :
  1. Open MATLAB App.
  2. Click in Add-Ons
  3. Select Get Add-Ons
  4. Install the required toolbox
Refer to the this given documentation for details : https://in.mathworks.com/help/audio/ref/detectspeech.html
  4 个评论
Felipe L. Teixeira
Felipe L. Teixeira 2023-7-15
@Harsh Kumar I only use this code, i don't know why give me an error in "gather function". I not invoque in any moment this function.


Image Analyst
Image Analyst 2023-7-15
When I run it on my computer, it says
'detectSpeech' requires Audio Toolbox.
Error in test1 (line 17)
so you need the "Audio Toolbox". The online version of MATLAB will have that toolbox while your local computer installation does not. Use the Add-ons button on the Home tab of the tool ribbon to get that toolbox.


Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by