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: mvfilter.m
    path of file: ./repos/fieldtrip/external/biosig/private
    
    the code of the file until where you have to start completion: function [x,z]=mvfilter(B,A,x,z)
% Multi-variate filter function
%
% Y = MVFILTER(B,A,X)
% [Y,Z] = MVFILTER(B,A,X,Z)
%
%  Y = MVFILTER(B,A,X) filters the data in matrix X with the
%    filter described by cell arrays A and B to create the filtered
%    data Y.  The filter is a "Direct Form II Transposed"
%    implementation of the standard difference equation:
% 
%    a0*Y(n) = b0*X(:,n) + b1*X(:,n-1) + ... + bq*X(:,n-q)
%                        - a1*Y(:,n-1) - ... - ap*Y(:,n-p)
%
%  A=[a0,a1,a2,...,ap] and B=[b0,b1,b2,...,bq] must be matrices of
%  size  Mx((p+1)*M) and Mx((q+1)*M), respectively. 
%  a0,a1,...,ap, b0,b1,...,bq are matrices of size MxM
%  a0 is usually the identity matrix I or must be invertible 
%  X should be of size MxN, if X has size NxM a warning 
%  is raised, and the output Y is also transposed. 
%
% A simulated MV-AR process can be generiated with 
%	Y = mvfilter(eye(M), [eye(M),-AR],randn(M,N));
%
% A multivariate inverse filter can be realized with 
%       [AR,RC,PE] = mvar(Y,P);
%	E = mvfilter([eye(M),-AR],eye(M),Y);
%
% see also: MVAR, FILTER

%	$Revision: 1.10 $
%	$Id: mvfilter.m,v 1.10 2005/05/25 02:52:49 pkienzle Exp $
%	Copyright (C) 1996-2003 by Alois Schloegl <a.schloegl@ieee.org>	

% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public
% License as published by the Free Software Foundation; either
% Version 2 of the License, or (at your option) any later version.
%
% This library is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with this library; if not, write to the
% Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA  02111-1307, USA.


[ra, ca] = size(A);
[rb, cb] = size(B);

    
function [x,z]=mvfilter(B,A,x,z)
% Multi-variate filter function
%
% Y = MVFILTER(B,A,X)
% [Y,Z] = MVFILTER(B,A,X,Z)
%
%  Y = MVFILTER(B,A,X) filters the data in matrix X with the
%    filter described by cell arrays A and B to create the filtered
%    data Y.  The filter is a "Direct Form II Transposed"
%    implementation of the standard difference equation:
% 
%    a0*Y(n) = b0*X(:,n) + b1*X(:,n-1) + ... + bq*X(:,n-q)
%                        - a1*Y(:,n-1) - ... - ap*Y(:,n-p)
%
%  A=[a0,a1,a2,...,ap] and B=[b0,b1,b2,...,bq] must be matrices of
%  size  Mx((p+1)*M) and Mx((q+1)*M), respectively. 
%  a0,a1,...,ap, b0,b1,...,bq are matrices of size MxM
%  a0 is usually the identity matrix I or must be invertible 
%  X should be of size MxN, if X has size NxM a warning 
%  is raised, and the output Y is also transposed. 
%
% A simulated MV-AR process can be generiated with 
%	Y = mvfilter(eye(M), [eye(M),-AR],randn(M,N));
%
% A multivariate inverse filter can be realized with 
%       [AR,RC,PE] = mvar(Y,P);
%	E = mvfilter([eye(M),-AR],eye(M),Y);
%
% see also: MVAR, FILTER

%	$Revision: 1.10 $
%	$Id: mvfilter.m,v 1.10 2005/05/25 02:52:49 pkienzle Exp $
%	Copyright (C) 1996-2003 by Alois Schloegl <a.schloegl@ieee.org>	

% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public
% License as published by the Free Software Foundation; either
% Version 2 of the License, or (at your option) any later version.
%
% This library is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with this library; if not, write to the
% Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA  02111-1307, USA.


[ra, ca] = size(A);
[rb, cb] = size(B);
[M,  N ] = size(x);

if (ra~=rb),
        fprintf(2,'ERROR MVFILTER: number of rows of A and B do not fit\n');
	return;
end