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: ft_preproc_lowpassfilter.m
    path of file: ./repos/automaticanalysis/external/MRtools/Utilities
    
    the code of the file until where you have to start completion: function [filt] = ft_preproc_lowpassfilter(dat,Fs,Flp,N,type,dir,instabilityfix)

% FT_PREPROC_LOWPASSFILTER applies a low-pass filter to the data and thereby
% removes all high frequency components in the data
%
% Use as
%   [filt] = ft_preproc_lowpassfilter(dat, Fsample, Flp, N, type, dir, instabilityfix)

    
function [filt] = ft_preproc_lowpassfilter(dat,Fs,Flp,N,type,dir,instabilityfix)

% FT_PREPROC_LOWPASSFILTER applies a low-pass filter to the data and thereby
% removes all high frequency components in the data
%
% Use as
%   [filt] = ft_preproc_lowpassfilter(dat, Fsample, Flp, N, type, dir, instabilityfix)
% where
%   dat        data matrix (Nchans X Ntime)
%   Fsample    sampling frequency in Hz
%   Flp        filter frequency
%   N          optional filter order, default is 6 (but) or depend