GetVarFromMatlab

Imports the specified Matlab timestamps vector as neuron or event variable.

Syntax

GetVarFromMatlab(doc, varname, isneuron)

Parameters

Parameter

Type

Description

doc

documentReference

Reference to the document.

varname

string

The name of the matrix in Matlab workspace. The matrix should be a number matrix with either one row or one column of data containing timestamps in seconds.

isneuron

number

If isneuron is 1, the imported variable is added to the list of Neurons. Otherwise, the variable is added to the list of events.

Return

None.

Examples

Python

import nex
doc = nex.GetActiveDocument()
# get the 1-column matrix ev1 and add it to the list of events
# for testing purposes, we create ev1 matrix using ExecuteMatlabCommand
nex.ExecuteMatlabCommand('ev1 = [0.5;2.3;4.7]')
nex.GetVarFromMatlab(doc, "ev1", 0)

NexScript

doc = GetActiveDocument()
% get the 1-column matrix ev1 and add it to the list of events
% for testing purposes, we create ev1 matrix using ExecuteMatlabCommand
ExecuteMatlabCommand("ev1 = [0.5;2.3;4.7]")
GetVarFromMatlab(doc, "ev1", 0)