@@ -63,6 +63,7 @@ logFile.extraColumns = {'Speed', 'is_Fixation'};
6363logFile = saveEventsFile('open', expParameters, logFile);
6464
6565% The information about 2 events that we want to save
66+ % NOTE : If the user DOES NOT provide `onset`, `trial_type`, this events will be skipped.
6667logFile(1,1).onset = 2;
6768logFile(1,1).trial_type = 'motion_up';
6869logFile(1,1).duration = 1;
@@ -118,6 +119,24 @@ saveEventsFile('close', expParameters, logFile);
118119
119120```
120121
122+ If you have many columns to define but only a few with several columns, you can do this:
123+
124+ ``` matlab
125+ % define the extra columns: they will be added to the tsv files in the order the user input them
126+ logFile.extraColumns = {'Speed', 'is_Fixation'};
127+
128+ [cfg, expParameters] = createFilename(cfg, expParameters);
129+
130+ % dummy call to initialize the logFile variable
131+ logFile = saveEventsFile('open', expParameters, logFile);
132+
133+ % set the real length we really want
134+ logFile.extraColumns.Speed.length = 12;
135+
136+ % actual inititalization
137+ logFile = saveEventsFile('open', expParameters, logFile);
138+ ```
139+
121140## Functions descriptions
122141
123142### userInputs
@@ -163,6 +182,9 @@ For the moment the date of acquisition is appended to the filename
163182
164183Function to save output files for events that will be BIDS compliant.
165184
185+ If the user DOES NOT provide ` onset ` , ` trial_type ` , this events will be skipped. ` duration ` will be set to "NaN" if
186+ no value is provided.
187+
166188### checkCFG
167189
168190Check that we have all the fields that we need in the experiment parameters.
0 commit comments