Syntax
y = Linear.interpolate(buffer,offset);
Description
Interpolate in buffer by using linear interpolation.
Input argument offset is a Real number marking the point at which interpolation shall take place.
offset=0 is the first buffer value buffer[1].
offset=size(buffer,1)-1 is the last buffer value buffer[size(buffer,1)].
It is required that 0 ≤ offset < size(buffer,1)-1.
The function returns the lineraly interpolated value.
In order to avoid issues at the end of the buffer
(where a minimally too large offset value triggers an assert),
it is best to make the buffer one element larger as needed.
For example, if the buffer is filled with a sample period of 1 ms
and every 100 samples an event occurs, then the buffer should have
length 102 for the samples 0 ms, 1 ms, 2 ms, ...., 100 ms, 101 ms.
Date |
Description |
Sep. 4, 2015 |
|
Generated at 2024-12-26T19:25:54Z
by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos