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: spm_meanby.m
    path of file: ./repos/bspm/thirdparty/spm8
    
    the code of the file until where you have to start completion: function [M,Mi,i] = spm_meanby(Y,I)
% Means of data in columns by group
% FORMAT [M,Mi,i] = spm_meanby(Y,I)
% Y  - Data matrix, data in columns. (Row vector Y also accepted.)
% I  - Column of indicator vectors, indicating group membership of rows of Y
%    - Multi-column I are treated as multiple factors to be interacted, 
%      and means are computed within each unique combination of the factor levels
% M  - Matrix of same size as Y, with observations replaced by the
%     appropriate group mean
% Mi - Mean for observations in each group, one column for each column of Y,
%      one row for each group (or unique factor level combination)
% i  - Group indicator values corresponding to rows of Mi
%_______________________________________________________________________
%

    
function [M,Mi,i] = spm_meanby(Y,I)
% Means of data in columns by group
% FORMAT [M,Mi,i] = spm_meanby(Y,I)
% Y  - Data matrix, data in columns. (Row vector Y also accepted.)
% I  - Column of indicator vectors, indicating group membership of rows of Y
%    - Multi-column I are treated as multiple factors to be interacted, 
%      and means are computed within each unique combination of the factor levels
% M  - Matrix of same size as Y, with observations replaced by the
%     appropriate group mean
% Mi - Mean for observations in each group, one column for each column of Y,
%      one row for each group (or unique factor level combination)
% i  - Group indicator values corresponding to rows of Mi
%_______________________________________________________________________
%
% spm_meanby computes means for grouped data presented as columns of
% data with a vector of group indicators
%_______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Andrew Holmes
% $Id: spm_meanby.m 1143 2008-02-07 19:33:33Z spm $



%-Check arguments
%=======================================================================
if nargin<0, error('insufficient arguments'), end