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: isCategorical.m
    path of file: ./repos/fieldtrip/external/bayesFactor/+bf/+internal
    
    the code of the file until where you have to start completion: function value = isCategorical(tbl,name)  
% Determine which columns in a table contain categorical variables.
% 
% tbl  - The table

    
function value = isCategorical(tbl,name)  
% Determine which columns in a table contain categorical variables.
% 
% tbl  - The table
% name - Optional. Specify a specific column or cell array of columns to
%           check. 
% OUTPUT
% value - logical matching the columns in tbl or the name cell-array
isCatColumn = @(x) (isa(x,'categorical') || iscellstr(x) || isstring(x) || ischar(x) || islogical(x));
value = logical(varfun(isCatColumn,tbl,'OutputFormat','Uniform'));
if nargin>1
    stay = ismember(tbl.Properties.VariableNames,name);
    value= value(stay);
end