Can't solve parse error
4 views (last 30 days)
Show older comments
Commented: Alexis on 8 Jul 2021
I am learning how to use inputParser and am stuck here:
function windowedAudio = windowAudio(audioIn,Fs,varargin)
defaultWin = 4;
defaultThresh = 0.1;
defaultRamp = 30;
defaultLong = 500;
defaultShort = 100;
p = inputParser;
It seems to run beyond that final line if I call the function with only the required arguments:
But when I try using one of the optional parameters,
Error using windowAudio (line 31)
The value of 'WindowLength' is invalid. Not enough input arguments.
I have been Googling forever and can't figure out what I have done wrong. Can anyone with fresh eyes help me here?
Alek Antic on 8 Jul 2021
I have reproduced your error and have found that your issue is most likely coming from your checkWinLen definition. It seems like it requires more than one argument, which is not allowed in a validation function, as documented here.
More Answers (0)
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!