I have a function f(x,a) where a is a parameter that is exogenously provided. I want to minimize f(x,a) for different values of a (a1 a2 a3 ...) independently. Is there any way to do that without using a for loop ?
If I consider defining f(x,[a1 a2 a3 ...]) as a multidimensional:
function f = obj(x,a)
f(1) = f(x,a1);
f(2) = f(x,a2);
f(3) = f(x,a3);
and then minimize f by providing the vector a=[a1 a2 a3 ...], Matlab will not consider the components of the function as independent as I want. Do you have any solution ?