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: glm_table.m
    path of file: ./repos/CanlabCore/CanlabCore/Statistics_tools
    
    the code of the file until where you have to start completion: function mytable = glm_table(stat, nms, varargin)
% mytable = glm_table(stat,nms, [betas], [any arg to suppress print])

    
function mytable = glm_table(stat, nms, varargin)
% mytable = glm_table(stat,nms, [betas], [any arg to suppress print])
%
% simple utility for printing a table from a glmfit output, intercept first
% do not include intercept name in nms (names) cell array.
%
% Can work for glmfit output or robustfit output.  If robustfit, input betas
% as 3rd argument

if nargin > 3
    doprint = false;
else
    doprint = true;
end