FirstAfter

Creates the new event containing the first timestamp of var1 in each of the intervals [var2+fromTime, var2+toTime].

Syntax

FirstAfter(var1, var2, fromTime, toTime)

Parameters

Parameter

Type

Description

var1

variableReference

Reference to the variable.

var2

variableReference

Reference to the variable.

fromTime

number

Offset of interval start around var2 timestamps

toTime

number

Offset of interval end around var2 timestamps

Return

Reference to the new variable.

Note

Creates the new event containing the first timestamp of var1 in each of the intervals [var2+from, var2+to].

Examples

Python

import nex
doc = nex.GetActiveDocument()
# find the first spike of Neuron05b after each stimulus (in the first second after stimulus)
doc["FirstN1"] = nex.FirstAfter(doc["Neuron05b"], doc["Stimulus"], 0, 1)

NexScript

doc = GetActiveDocument()
% find the first spike of Neuron05b after each stimulus (in the first second after stimulus)
doc["FirstN1"] = FirstAfter(doc["Neuron05b"], doc["Stimulus"], 0, 1)