2.3.7 findTrials() - shunnnli/NeuroDAP GitHub Wiki

Overview

Given an event time and a trial table of that session, return at which trial (i.e. trial number) this event happens.

Inputs and options

Required inputs

  • eventTime: double, the sample number when this event happens
  • trialTable: table, trial table of that session.
    • For the function to work, there should be column CueTime and column NextCue in each row of the table. This stores the sample number of the current cue (or any trial starting events) and the sample number of the next cue, respectively.

Outputs

  • trialNumber: a 1xn vector (same size of eventTime) storing the corresponding trial during which this event happens

Examples

waterIdx = [91170 155489 484440	692786 1370838 1856682 2074188 2735302 2909160 3834913];
waterTrials = findTrials(waterIdx,trials);

image