June 04, 2019 06:56PM
In NIMH ML, TrialRecord is a class object, not a struct. It is not allowed to add new fields to it. If you need custom fields in TrialRecord to pass variables around, use TrialRecord.User instead.
TrialRecord.var1 = 200;       % fine in the original ML, but not in NIMH ML
TrialRecord.User.var1 = 200;  % good with NIMH ML

Note that none of the fields you create under TrialRecord.User are automatically saved to the data file. You should use the bhv_variable function to keep the records of them.

TrialRecord has a few other user-editable fields for task flow control and screen updates.
TrialRecord.Pause = true;                  % make the task pause after the current trial
TrialRecord.Quit = true;                   % make the task quit after the current trial
TrialRecord.DrawTimeLine = false;          % stop updating the time line panel
TrialRecord.MarkSkippedFrames = true;      % place eventcode 13 for every skipped frame
TrialRecord.DiscardSkippedFrames = false;  % present skipped frames again

For the full description of TrialRecord, see

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.