lass="codeinput">xsol = fminsearchcon(rosen,[3 3],[2 2])
</pre><pre class="codeoutput">
xsol =

            2            4

</pre><h2>Only upper bound constraints<a name="3"></a></h2><pre class="codeinput">xsol = fminsearchcon(rosen,[-5 -5],[],[0 0])
</pre><pre class="codeoutput">
xsol =

  -1.0447e-13  -1.4451e-08

</pre><h2>Dual constraints<a name="4"></a></h2><pre class="codeinput">xsol = fminsearchcon(rosen,[2.5 2.5],[2 2],[3 3])
</pre><pre class="codeoutput">
xsol =

            2            3

</pre><