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_statistics_mvpa.m
    path of file: ./repos/fecgsyn/subfunctions/data-generation/libs/fieldtrip
    
    the code of the file until where you have to start completion: function [stat, cfg] = ft_statistics_mvpa(cfg, dat, design)

% FT_STATISTICS_MVPA performs multivariate pattern classification
% on the data. If the data has not been averaged over time, classification
% is performed separately for every time point. Additionally, searchlight
% analysis (classification for each channel/voxel
% separately) or time x time generalisation can be performed.
%
% This function should not be called directly, instead
% you should call the function that is associated with the type of
% data on which you want to perform the test.
%
% Use as
%   stat = ft_timelockstatistics(cfg, data1, data2, data3, ...)
%   stat = ft_freqstatistics    (cfg, data1, data2, data3, ...)
%   stat = ft_sourcestatistics  (cfg, data1, data2, data3, ...)
% w
    
function requires numeric data as input, you probably want to use FT_TIMELOCKSTATISTICS, FT_FREQSTATISTICS or FT_SOURCESTATISTICS instead');
assert(isnumeric(design), 'this function requires numeric data as input, you probably want to use FT_TIMELOCKSTATISTICS, FT_FREQSTATISTICS or FT_SOURCESTATISTICS instead');

% cfg: set defaults
cfg.searchlight     = ft_getopt(cfg, 'searchlight', 'no');
cfg.timextime       = ft_getopt(cfg, 'timextime',   'no');
cfg.mvpa            = ft_getopt(cfg, 'mvpa',        []);
cfg.mvpa.metric     = ft_getopt(cfg.mvpa, 'metric',   'accuracy');
cfg.mvpa.feedback   = ft_getopt(cfg.mvpa, 'feedback',   'yes');
cfg.mvpa.neighbours = ft_getopt(cfg.mvpa, 'neighbours', []);

% flip dimensions such that the number of trials comes first
dat = dat';

% if cfg.dim has two entries which are non-singleton then the data has been
% 3D before. We must reshape it from 2D to 3D to run it in MVPA-Light
data_is_3D = (numel(cfg.dim) > 1 && all(cfg.dim > 1));  % checks whether data was 3D before being reshaped
if data_is_3D
  dat = reshape(dat, size(dat,1), cfg.dim(1), cfg.dim(2));
end