62          100          41.6298         reflect
 
Exiting: Maximum number of function evaluations has been exceeded
         - increase MaxFunEvals option.
         Current function value: 41.629797 


xsol =

        1.652      0.54831       2.4744       1.2291      0.56971

</pre><h2>Exactly fix one variable, constrain some others, and set a tolerance<a name="11"></a></h2><pre class="codeinput">opts = optimset(<span class="string">'fminsearch'</span>);
opts.TolFun = 1.e-12;

LB = [-inf 2 1 -10];
UB = [ i