t found.');
    end
    if verbosity > 0
        fprintf('%s\n',msg);
    end
    return;
end

% User interruption
if optimState.stopOutput || optimState.stopPlot
    EXITFLAG = -1;
    run = false;
    msg = sprintf('%s','Stop requested.');
    if verbosity > 0
        fprintf('%s\n',msg);
    end
    return;
end

% Maxiter test
if Iter > options.MaxIter
    EXITFLAG = 0;
    run  = false;
    msg = sprintf('%s', 'Maximum number of iterations exceeded: ');
    msg = [msg,sprintf('%s', 'increase options.Max