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: mi_model_gd.m
    path of file: ./repos/fieldtrip/external/gcmi
    
    the code of the file until where you have to start completion: function I = mi_model_gd(x, y, Ym, biascorrect, demeaned)
% MI_MODEL_GD Mutual information (MI) between a Gaussian and a discrete
%         variable in bits bits based on ANOVA style model comparison.
%   I = mi_model_gd(x,y,Ym) returns the MI between the (possibly multidimensional)
%   Gaussian variable x and the discrete variable y.
%   For 1D x this is a lower bound to the mutual information.
%   Rows of x correspond to samples, columns to dimensions/variables. 
%   (Samples first axis)
%   y should contain integer values in the range [0 Ym-1] (inclusive).
%
%   biascorrect : true / false option (default true) which specifies whether
%   bias correction should be applied to the esimtated MI.

    
function I = mi_model_gd(x, y, Ym, biascorrect, demeaned)
% MI_MODEL_GD Mutual information (MI) between a Gaussian and a discrete
%         variable in bits bits based on ANOVA style model comparison.
%   I = mi_model_gd(x,y,Ym) returns the MI between the (possibly multidimensional)
%   Gaussian variable x and the discrete variable y.
%   For 1D x this is a lower bound to the mutual information.
%   Rows of x correspond to samples, columns to dimensions/variables. 
%   (Samples first axis)
%   y should contain integer values in the range [0 Ym-1] (inclusive).
%
%   biascorrect : true / false option (default true) which specifies whether
%   bias correction should be applied to the esimtated MI.
%   demeaned : false / true option (default false) which specifies whether the
%   input data already has zero mean (true if it has been copula-normalized)
%   See also: MI_MIXTURE_GD

% ensure samples first axis for vectors
if isvector(x)
    x = x(:);
end