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: test_example_bids_eeg20220113.m
    path of file: ./repos/fieldtrip/test
    
    the code of the file until where you have to start completion: function test_example_bids_eeg

% MEM 2gb
% WALLTIME 00:10:00
% DATA public



%
%% Converting an example EEG dataset for sharing in BIDS
%
% This example describes how to use **[data2bids](https://github.com/fieldtrip/fieldtrip/blob/release/data2bids.m)** to convert an EEG dataset for sharing according to the [BIDS standard](https://bids.neuroimaging.io).

    
function test_example_bids_eeg

% MEM 2gb
% WALLTIME 00:10:00
% DATA public



%
%% Converting an example EEG dataset for sharing in BIDS
%
% This example describes how to use **[data2bids](https://github.com/fieldtrip/fieldtrip/blob/release/data2bids.m)** to convert an EEG dataset for sharing according to the [BIDS standard](https://bids.neuroimaging.io).
%
% If you want to share data, there are multiple things to consider. For example the file format of the data, the place to share the data (openneuro/zenodo/figshare/dataverse), the access mechanism for the data (ftp/http/sftp), the license or data use agreement, whether all data or only part of the data is shared, using pseudonyms in the description of the data, scrubbing the date and time of recording, removing identifying features from the data, etc.
%
% In this example we will only be dealing with the format in which the data is organized (over directories) and stored (in files), for which we use BIDS. Please see the [BIDS website](https://bids.neuroimaging.io) for background information and the [BIDS specification](https://bids-specification.readthedocs.io/en/stable/) for further details on the file and directory organization.
%
% We will describe two approaches: in the first the data files are is kept in their original format, in the second approaches the files are explicitly converted to BrainVision (the recommended format for EEG data in BIDS). Prior to conversion the data (in principle) comprises 10 files, one EEG file per subject. After conversion there are 52 or 72 files for the two approaches, which includes the EEG data and the sidecar files with metadata.
%
% It is important that you use appropriate tools. BIDS stores metadata in TSV and JSON files, which makes then not only machine readable, but also human readable. A good graphical text/code editor helps you to navigate through the full directory structure and check or update the content of individual files. We recommend the [atom editor](http://atom.io/), but there are good [alternatives](https://alternativeto.net/software/atom/).
%
% The BIDS standard for EEG is introduced in [this preprint publication](https://psyarxiv.com/63a4y/), which has been peer reviewed and accepted for publication in [Scientific Data](http://nature.com/sdata/). The full [BIDS specification](https://bids-specification.readthedocs.io/en/stable/) including MEG, iEEG, MRI and behavioral data is maintained and available online.
%
%% # Converting to BIDS - copying the data
%
% If your EEG data is in a format supported by BIDS, you only have to rename the files and organize them in the right directory structure. After that, you have to add the required metadata.
%
% Rather than starting with 10 real EEG recordings, we can download a publicly available EEG file and copy it multiple times, pretending that this file contains the EEG data for each of our subjects. You can download the dataset from the EEGLAB website at <https://sccn.ucsd.edu/mediawiki/images/9/9c/Eeglab_data.set>.
%
sub = {'01', '02', '03', '04', '05', '06', '07', '08', '09', '10'};

% for subject 3 the age is unknown, for subject 2 the sex is not specified
age = [11  96  nan 77  82  87  18 40  26  80];
sex = {'f' [] 'f' 'f' 'f' 'm' 'm' 'm' 'm' 'm'};

for subindx=1:numel(sub)

  cfg = [];
  cfg.method    = 'copy';
  cfg.datatype  = 'eeg';

  % specify the input file name, here we are using the same file for every subject
  cfg.dataset   = dccnpath('/home/common/matlab/fieldtrip/data/ftp/example/bids_eeg/original/Eeglab_data.set');

  % specify the output directory
  cfg.bidsroot  = fullfile(tempdir,'bids');
  cfg.sub       = sub{subindx};

  % specify the information for the participants.tsv file
  % this is optional, you can also pass other pieces of info
  cfg.participants.age = age(subindx);
  cfg.participants.sex = sex{subindx};

  % specify the information for the scans.tsv file
  % this is optional, you can also pass other pieces of info
  cfg.scans.acq_time = datestr(now, 'yyyy-mm-ddThh:MM:SS'); % according to RFC3339

  % specify some general information that will be added to the eeg.json file
  cfg.InstitutionName             = 'University of California San Diego';
  cfg.InstitutionalDepartmentName = 'Schwartz Center for Computational Neuroscience';
  cfg.InstitutionAddress          = '9500 Gilman Drive # 0559; La Jolla CA 92093, USA';

  % provide the mnemonic and long description of the task
  cfg.TaskName        = 'changedetection';
  cfg.TaskDescription = 'Subjects were responding as fast as possible upon a change in a visually presented stimulus.';

  % these are EEG specific
  cfg.eeg.PowerLineFrequency = 60;   % since recorded in the USA
  cfg.eeg.EEGReference       = 'M1'; % actually I do not know, but let's assume it was left mastoid

  data2bids(cfg);

end