Too many input arguments

3 次查看(过去 30 天)
Kia
Kia 2023-8-18
回答: Voss 2023-8-18
Hello,
Can somebody explain to me why when I run the code I get this message.
Error using aresparams
Too many input arguments.
Error in test (line 17)
trainParams = aresparams('maxFuncs', -1, 'c', 3, 'cubic', true, 'cubicFastLevel', 2,'selfInteractions',1, 'maxInteractions', 1, 'threshold',1e-4,'prune',
true, 'fastK',20, 'fastBeta',1, 'fastH',5,'useMinSpan', -1,'useEndSpan',-1, 'maxFinalFuncs',inf, 'endSpanAdjust',1, 'newVarPenalty',0.1,'terminateWhenInfGCV',false, 'allowLinear',0);
  2 个评论
Dyuman Joshi
Dyuman Joshi 2023-8-18
There is no built-in or toolbox function named as aresparams in MATLAB.
Seems like it's a user-defined function.
Please copy and paste the output of this code -
which -all aresparams
Image Analyst
Image Analyst 2023-8-18
It's not a built-in MATLAB function. Check the documentation for it.
help aresparams
--- aresparams not found. Showing help for parseparams instead. --- PARSEPARAMS Finds first string argument. [REG, PROP]=PARSEPARAMS(ARGS) takes cell array ARGS and separates it into two argument sets: REG being all arguments up to, but excluding, the first string argument encountered in ARGS. PROP contains all other arguments after, and including, the first string argument encountered. PARSEPARAMS is intended to isolate possible property value pairs in functions using VARARGIN as the input argument.

请先登录,再进行评论。

回答(1 个)

Voss
Voss 2023-8-18
According to section 2.2 (page 7) of the attached pdf document, aresparams should be called like:
trainParams = aresparams(maxFuncs, c, cubic, cubicFastLevel, ...
selfInteractions, maxInteractions, threshold, prune, fastK, fastBeta, fastH, ...
useMinSpan, useEndSpan, maxFinalFuncs, endSpanAdjust, newVarPenalty, ...
terminateWhenInfGCV, yesInteract, noInteract, allowLinear, forceLinear)
Which means that you don't pass the parameter names ('maxFuncs','c','cubic', etc.), only their values (-1,3,true, etc.).
So instead of this:
trainParams = aresparams('maxFuncs', -1, 'c', 3, 'cubic', true, 'cubicFastLevel', 2, ...
'selfInteractions',1, 'maxInteractions', 1, 'threshold',1e-4,'prune',true, 'fastK',20, ...
'fastBeta',1, 'fastH',5,'useMinSpan', -1,'useEndSpan',-1, 'maxFinalFuncs',inf, ...
'endSpanAdjust',1, 'newVarPenalty',0.1,'terminateWhenInfGCV',false, 'allowLinear',0);
Do this:
trainParams = aresparams(-1, 3, true, 2, 1, 1, 1e-4, true, 20, 1, 5, -1, -1, inf, 1, 0.1, false, 0);

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by