フィルターのクリア

Particle Swarm - Additional Arguments

4 ビュー (過去 30 日間)
Luce Ca
Luce Ca 2016 年 5 月 12 日
コメント済み: Luce Ca 2016 年 5 月 13 日
Hello,
I have to send some additional arguments to my objective function fun.
If I do this, I get an error saying that I have too many input arguments.
[xn3,fvaln3,exitflagn3,outputn3] = particleswarm(@fun,nvars,lb,ub,options, additionalArguments);
Then I tried the following thing but I got an error saying I can't have a structure as an input argument.
[xn3,fvaln3,exitflagn3,outputn3] = particleswarm({@fun,additionalArguments},nvars,lb,ub,options);
Thanks in advance!

採用された回答

Alan Weiss
Alan Weiss 2016 年 5 月 12 日
That older way of passing additional arguments is supported but not documented for older functions. Newer functions do not support it at all.
For supported, documented ways of passing extra parameters, see the documentation.
Alan Weiss
MATLAB mathematical toolbox documentation
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 5 月 13 日
simulannealbnd does not have A, b, Aeq, beq or nonlcon arguments .
[Param,fval, exitflag,output] = simulannealbnd(f, Param0, LB, UB, options);
Luce Ca
Luce Ca 2016 年 5 月 13 日
Sloppy me, thank you!

サインインしてコメントする。

その他の回答 (1 件)

Stalin Samuel
Stalin Samuel 2016 年 5 月 12 日
You cannot add additional arguments to matlab predefined functions. click hrer for more about particleswarm
  1 件のコメント
Luce Ca
Luce Ca 2016 年 5 月 12 日
編集済み: Luce Ca 2016 年 5 月 12 日
For other optimisation algorithms and functions I have no problem sending the additional parameters in the two ways I mentioned, i.e. I used the second way in pattern-search.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOptimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by