mg src="ncg_doc_eq07165327077797634723.png" alt="$a = 3$" style="width:13px;height:4px;">, and use a random starting point.</p><pre class="codeinput">randn(<span class="string">'state'</span>,0);
x0 = randn(10,1)
out = ncg(@(x) example1(x,3), x0)
</pre><pre class="codeoutput">
x0 =

   -0.4326
   -1.6656
    0.1253
    0.2877
   -1.1465
    1.1909
    1.1892
   -0.0376
    0.3273
    0.1746

 Iter  FuncEvals       F(X)          ||G(X)||/N        
------ --------- ---------------- ----------------
     0    