Vector
Posted: Fri Oct 06, 2023 2:22 am
Hi
I would like to create a vector in script lua like this: A = 0:0.1:1. It means A starts from 0 and stops at 1 by step 0.1. To create this vector in Lua, I used the following code:
A = {}
function init(model, par)
end
function update(model)
local start = 0
local stop = 1
local step = 0.1
for i = start, stop, step do
A[#A + 1] = i
end
end
function store_data(frame)
frame:set_value("A", A)
end
However, A is zero in Analysis plots as following picture. Would you help me how to correct it? (A is Rtime ) Best
I would like to create a vector in script lua like this: A = 0:0.1:1. It means A starts from 0 and stops at 1 by step 0.1. To create this vector in Lua, I used the following code:
A = {}
function init(model, par)
end
function update(model)
local start = 0
local stop = 1
local step = 0.1
for i = start, stop, step do
A[#A + 1] = i
end
end
function store_data(frame)
frame:set_value("A", A)
end
However, A is zero in Analysis plots as following picture. Would you help me how to correct it? (A is Rtime ) Best