MATLAB: Optimizing 2 parameters with fmincon

fminconMATLABoptimization

I was optimizing a function named ML with fmincon to find the parameter "theta",
twostage = fmincon(@(theta)ML(theta,param,x,y),theta,[],[],[],[],lb,ub,[],options);
now I want to optimize another function ML2 for two parameters "theta1" and "theta2", can fmincon optimize a function for 2 parameters? how should I write the function?
Thanks

Best Answer

Make theta a 2x1 vector instead and rewrite ML accordingly, to interpret theta as a 2x1 input vector. Also make ub and lb 2x1.
Related Question