SetContVarTimestampsAndValues
Sets the timestamps and continuous values of a NexVar
object representing continuous variable.
Syntax
var.SetContVarTimestampsAndValues(timestamps, values)
Parameters
Parameter |
Type |
Description |
---|---|---|
timestamps |
list |
list containing timestamps in seconds |
values |
list |
list containing values in milliVolts |
Return
None.
Note
Python only.
Examples
Python
import nex
import numpy as np
doc = nex.GetActiveDocument()
doc["ScriptGenerated"] = nex.NewContVarWithFloats(doc, 1000)
doc["ScriptGenerated"].SetContVarTimestampsAndValues([0,0.001,0.002],[1,2,22])
start_time = 0
end_time = 100
sample_rate = 1000
time = np.arange(start_time, end_time, 1.0/sample_rate)
frequency = 10
sinewave = np.sin(2 * np.pi * frequency * time)
doc["sine wave"] = nex.NewContVarWithFloats(doc, sample_rate)
doc["sine wave"].SetContVarTimestampsAndValues(time, sinewave)