You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ncg_doc.m
    path of file: ./repos/poblano_toolbox/docs
    
    the code of the file until where you have to start completion: %% Poblano Toolbox for MATLAB: Nonlinear Conjugate Gradie
    
function for the nonlinear conjugate gradient methods is
% called |ncg|.
%%
%
% <html><hr></html>
%% Method Description
%
% The general steps of NCG methods are given below in high-level
% pseudo-code:
%%
%
% 
% $$
% \begin{tabular}{ll}
% \emph{1.} & Input: $x_0$, a starting point\\
% \emph{2.} & Evaluate $f_0 = f(x_0), g_0 = \nabla f(x_0)$\\
% \emph{3.} & Set $p_0 = -g_0, i = 0$\\
% \emph{4.} & \textbf{while} $\|g_i\| > 0$\\
% \emph{5.} & \qquad Compute a step length $\alpha_i$ and set $x_{i+1} = x_i + \alpha_i p_i$\\
% \emph{6.} & \qquad Set $g_i = \nabla f(x_{i+1})$\\
% \emph{7.} & \qquad Compute $\beta_{i+1}$\\
% \emph{8.} & \qquad Set $p_{i+1} = -g_{i+1} + \beta_{i+1} p_i$\\
% \emph{9.} & \qquad Set $i = i + 1$\\
% \emph{10.} & \textbf{end