s</span>
ncg_opts = ncg(<span class="string">'defaults'</span>);
<span class="comment">% Tighten the stop tolerance (norm of gradient). This is often too large.</span>
ncg_opts.StopTol = 1.0e-6;
<span class="comment">% Tighten relative change in function value tolearnce. This is often too large.</span>
ncg_opts.RelFuncTol = 1.0e-20;
<span class="comment">% Increase the number of iterations.</span>
ncg_opts.MaxIters = 10^4;
<span class="comment">% Only display every 10th iteration</span>
ncg_opts.DisplayIter