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: opti_ipopt.m
    path of file: ./repos/OPTI/Solvers
    
    the code of the file until where you have to start completion: function [x,fval,exitflag,info] = opti_ipopt(nlprob,x0)
%OPTI_IPOPT Solve a NLP using IPOPT
%
%   [x,fval,exitflag,info] = opti_ipopt(nlprob,x0) solves the nonlinear

    
function [x,fval,exitflag,info] = opti_ipopt(nlprob,x0)
%OPTI_IPOPT Solve a NLP using IPOPT
%
%   [x,fval,exitflag,info] = opti_ipopt(nlprob,x0) solves the nonlinear
%   program min f(x) subject to linear and nonlinear constraints using
%   IPOPT. nlprob is supplied in nl opti format (i.e. from convIpopt())
%   and x0 is the initial solution guess.
%
%   THIS IS A WRAPPER FOR IPOPT
%   See supplied Eclipse Public License

%   Copyright (C) 2011-2013 Jonathan Currie (Control Engineering)

t = tic;
%Check required fields
if(~isfield(nlprob,'funcs') || ~isfield(nlprob,'options'))
    error('You must use convert(optiObj) or solve(optiObj) to generate a problem structure for this function');
end