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: selparam.m
    path of file: ./repos/spm12/external/fieldtrip/utilities/private
    
    the code of the file until where you have to start completion: function param = selparam(data)

% SELPARAM(DATA) extracts the fieldnames param of the structure data containing functional
% data, which have a dimensionality consistent with the dimord field in the data. Selparam
% is a helper function to selectdata


    
function param = selparam(data)

% SELPARAM(DATA) extracts the fieldnames param of the structure data containing functional
% data, which have a dimensionality consistent with the dimord field in the data. Selparam
% is a helper function to selectdata

[dim, fn] = dimlength(data);
if numel(fn)==1 && strcmp(fn{1}, 'dimord'),
  %data is not source data
  dim = dim{1};
elseif numel(fn)>1,
  %data is source data new style
  ft_error('selparam only works with input data which is not of type ''source''');
end