main.m
...
param = ...;
x0 = [0,0];
[newX, fval] = fminimax(@myfun, x0)
...
myfun.m
function f = myfun(x)
f(1)=function of (x, param);
f(2)=another function of (x, param);
f(3)=...
...
f(5)=the last function of (x, param);
end
How can I pass the parameter 'param' to myfun file?
I tried to like the following, but error occurs.
...
param = ...;
x0 = [0,0];
[newX, fval] = fminimax(@myfun, x0, param)
...
and
function f = myfun(x, param)
f(1)=function of (x, param);
f(2)=another function of (x, param);
f(3)=...
...
f(5)=the last function of (x, param);
end