Welcome! Log In Create A New Profile

Advanced

TrialRecord

Posted by Jaewon 
TrialRecord
June 04, 2019 06:56PM
In the original ML, users could add custom fields to TrialRecord to pass variables around. In NIMH ML, such a trick does not work, because TrialRecord is a class object, not a struct. If you need custom fields in TrialRecord, 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 https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.html.

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.