TrialRecord Structure

TrialRecord is a MATLAB struct that contains information about the trial history. This structure has the following fields that are updated every trial.

Fields of TrialRecord Remarks
CurrentTrialNumber The currently executing trial number, consecutively numbered from the start of the session (scalar)
CurrentTrialWithinBlock The currently executing trial number, consecutively numbered from the start of the current block (scalar)
CurrentCondition The condition number of the current trial (scalar)
CurrentBlock The block number of the current trial (scalar)
CurrentBlockCount The total number of blocks played thus far, including the current one (scalar)
CurrentConditionInfo A struct created from the "info" column of the conditions file
CurrentConditionStimulusInfo Information about the stimuli used in the current trial (cell array, one cell per TaskObject)
ConditionsPlayed The list of conditions played since the start of the session (a vector of length (CurrentTrialNumber - 1))
ConditionsThisBlock The list of conditions which are available for selection from within the current block (vector of variable length)
BlocksPlayed The list of blocks played since the start of the session (a vector of length (CurrentTrialNumber - 1))
BlockCount The number of blocks played, as of any given trial thus far (a vector of length (CurrentTrialNumber - 1))
BlockOrder The order of blocks played thus far, including the current block (vector)
BlocksSelected The list of blocks available, as selected from the main menu (vector)
TrialErrors The list of behavioral errors for every trial played so far (a vector of length (CurrentTrialNumber - 1))
ReactionTimes The list of reaction times for every trial played so far (a vector of length (CurrentTrialNumber - 1))
LastTrialAnalogData A structure containing the fields EyeSignal and Joystick, with the x- and y-vectors of the last trial's analog signals
LastTrialCodes A structure containing the fields CodeNumbers and CodeTimes, containing vectors corresponding to each
Editable A struct of "editable" variables defined in the timing script
DataFile Name of the current data file

While the above fields are automatically updated by NIMH ML and not editable, TrialRecord has a few other user-editable fields for task flow control and screen updates.

Fields of TrialRecord Default Value Remarks
Pause false If true, the task pauses after the current trial.
Quit false If true, the task quits after the current trial.
DrawTimeLine true If false, the Time Line panel of the control screen is NOT updated after each trial. This option is useful to suppress the output, when there are too many event codes to draw.
MarkSkippedFrames false If true, eventcode 13 is marked in case of frame skipping.
DiscardSkippedFrames true If true, missing frames of movies are discarded when skipped frames occur.
User struct This is a field that users can store temporary variables that they want to pass to other functions across trials.

TrialRecord is used as input to many functions during tasks, such as timing scripts, condition-selection functions, block-selection functions, block-change functions, user-plot functions and user-generated image functions. If you need to deliver additional input to those functions, you can do so by creating new fields under TrialRecord.User and assign values there.

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.