,1)
</pre><pre class="codeoutput">
ans =

       0.6187       0.3813

</pre><h2>Nonlinear inequality, norm(x) &lt;= 1<a name="8"></a></h2><pre class="codeinput">fminsearchcon(rosen,[0 0],[],[],[],[],@(x) norm(x) - 1)
</pre><pre class="codeoutput">
ans =

      0.78633      0.61778

</pre><h2>Minimize a linear objective, subject to a nonlinear constraints.<a name="9"></a></h2><pre class="codeinput">fun = @(x) x*[-2;1];
nonlcon = @(x) [norm(x) - 1;sin(sum(x))];
fminsearchcon(fun,[0 0],[],[],[],[],nonlcon)
</p