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: lincoa.m
    path of file: ./repos/prima/matlab/interfaces
    
    the code of the file until where you have to start completion: function [x, fx, exitflag, output] = lincoa(varargin)
%LINCOA is a solver for solving the following linearly-constrained  continuous
%   optimization problem without using derivatives:
%
%   minimize    fun(x)
%       s.t.    Aineq * x <= bineq,
%               Aeq * x = beq,
%               lb <= x <= ub.
%
%   In the backend, LINCOA calls the late Professor M. J. D. Powell's algorithm
%   with the same name.
%
%   The interface of LINCOA is similar to that of function FMINCON included
%   in the Optimization Toolbox of MATLAB, except that LINCOA does not accept
%   nonlinear constraints. So LINCOA can be called in a way similar to calling
%   FMINCON. In addition, LINCOA can also be called in some more flexible ways.
%
%   1. Basic syntax
%
%   Similar to FMINCON, the command
%
%   x = lincoa(fun, x0, Aineq, bineq, Aeq, beq, lb, ub)
%
%   solves the problem formulated above, where
%
%   *** fun is the name or function handle of the objective function; if
%       there is no objective function (i.e., we have a feasibility problem),
%       then set fun = []
%   *** x0 is the starting point; x0 CANNOT be omitted or set to []
%   *** Aineq and bineq are the coefficient matrix and right-hand side of
%       the linear inequality constraint Aineq * x <= bineq; if there is
%       no such constraint, set Aineq = [], bineq = []
%   *** Ae
    
function is a private function generating only private errors;
    % however, public errors can occur due to, e.g., evalobj; error handling needed
    try
        [x, fx, constrviolation, exitflag, nf, xhist, fhist, chist] = ...
            fsolver(fun, x0, Aineq, bineq, Aeq, beq, lb, ub, rhobeg, rhoend, eta1, eta2, gamma1, ...
            gamma2, ftarget, ctol, cweight, maxfun, npt, iprint, maxhist, double(output_xhist), maxfilt);
        % Fortran MEX does not provide an API for reading Boolean variables. So we convert
        % output_xhist to a double (0 or 1) before passing it to the MEX gateway.
        % In C MEX, however, we have mxGetLogicals.
    catch exception
        if ~isempty(regexp(exception.identifier, sprintf('^%s:', funname), 'once')) % Public error; displayed friendly
            error(exception.identifier, '%s\n(error generated in %s, line %d)', exception.message, exception.stack(1).file, exception.stack(1).line);
        else % Private error; displayed as is
            rethrow(exception);
        end
    end

    % Record the results of the solver in OUTPUT
    output.x = x;
    output.fx = fx;
    output.exitflag = exitflag;
    output.funcCount = nf;
    if output_xhist
        output.xhist = xhist;
    end
    output.fhist = fhist;
    output.constrviolation = constrviolation;
    output.chist = chist;
end

% Postprocess the result
try % postprima is a private function that may generate public errors; error-handling needed
    [x, fx, exitflag, output] = postprima(probinfo, output);
catch exception
    if ~isempty(regexp(exception.identifier, sprintf('^%s:', funname), 'once')) % Public error; displayed friend