Particle Swarm - Additional Arguments
4 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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.
Alan Weiss
MATLAB mathematical toolbox documentation
3 个评论
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);
更多回答(1 个)
Stalin Samuel
2016-5-12
You cannot add additional arguments to matlab predefined functions. click hrer for more about particleswarm
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!