Say that I have an anonymous function with the inputs v and config:
obj_fun = @(v, config) config.dt*(config.e_w*(v(1)^2 + v(2)^2 + config.e_s))*config.m + 2*sqrt((config.G(1)^2 - config.p(1) - config.dt*v(1))^2 + (config.G(2) - config.p(2) -config.dt*v(2))^2)*sqrt(config.e_w*config.e_s)*config.m;
Now, let's say I want I have the values of config and I just an anonymous function in terms of v.
So, I will have:
obj_fun_2 = @(v)...
How can I do that. The main motivation behind this is that I want to use the function, fmincon, but it seems that fmincon only works if your anonymous function has only one input. How can I address this issue? I remember seeing this before. How can I solve this problem.
So, I want something like,
fmincon(obj_fun(..., config),guess, A,B).
where guess is where the algorithm initially starts and A and B are the parameters for the constraints. I just want some variant of this.