GetContVarFromMatlab

Imports the specified matrix from Matlab. Each column of the matrix is imported as a continuous variable.

Syntax

GetContVarFromMatlab(doc, MatrixName, TimestampOfFirstValue, TimeStep)

Parameters

Parameter

Type

Description

doc

documentReference

Reference to the document.

MatrixName

string

The name of a matrix in Matlab workspace.

TimestampOfFirstValue

number

The timestamp (in seconds) of the first value of each continuous variable

TimeStep

number

Digitizing time step (in seconds) of the imported variables.

Return

None.

Note

This function adds continuous variables to the specified document. The names of the variables include the MatrixName and the column number.

Examples

Python

import nex
doc = nex.GetActiveDocument()
# import matrix contData from Matlab. first timestamp is 0, time step is 0.001s.
# for testing purposes, we create contData matrix using ExecuteMatlabCommand
nex.ExecuteMatlabCommand('contData = [1 2; 11 12]')
nex.GetContVarFromMatlab(doc, "contData", 0, 0.001)

NexScript

doc = GetActiveDocument()
% import matrix contData from Matlab. first timestamp is 0, time step is 0.001s.
% for testing purposes, we create contData matrix using ExecuteMatlabCommand
ExecuteMatlabCommand("contData = [1 2; 11 12]")
GetContVarFromMatlab(doc, "contData", 0, 0.001)