re><pre class="codeoutput">
ans =

      0.70707     -0.70713

</pre><h2>Provide your own fminsearch options<a name="10"></a></h2><pre class="codeinput">opts = optimset(<span class="string">'fminsearch'</span>);
opts.Display = <span class="string">'iter'</span>;
opts.TolX = 1.e-12;
opts.MaxFunEvals = 100;

n = [10,5];
H = randn(n);
H=H'*H;
Quadraticfun = @(x) x*H*x';

<span class="comment">% Global minimizer is at [0 0 0 0 0].</span>
<span class="comment">% Set all lower bound constraints, all of which will