I have an objective function that has 4 variables to solve for so that the output is minimal and I am having trouble understanding the syntax required to use the function "fminsearch" for solving for more than one variable. Here is my objective function:
function f4 = v4_objfunc(w_x,w_y,s_x,s_y)
f4 = 6*(w_x)^2 + 6*(w_y)^2 + 12*(s_x)^2 + 12*(s_y)^2 - 330*w_x - 228*w_y - 990*s_x -
684*s_y - 6*w_x*s_x - 6*w_y*s_y + 86564;
end
That is the ".m" function file exactly as I have it saved. How do I use fminsearch to get the values of "w_x","w_y","s_x","s_y" that will result in the minimal outcome? If it helps any, the unknowns correspond to x-and-y values (for coordinates) and they only need to be checked between 0-100 (for all 4).
I have used the function page that Matlab offers, but have only understood how to use fminsearch for single-variable functions.