Transform a scilab variable into a vector of double
vec = var2vec(var)
var2vec / vec2var functions are used inside the interfacing functions of Scilab blocks to give the possibility to the user to handle Scilab objects with the real parameter (rpar) and with the discrete state register (z).
These functions are also used internally for some fields in blocks (odstate, opar, etc...).
![]() | The serialized data are supposed to be accessible by the simulation function.
For complex Scilab objects (struct, handle, file content, etc...), you could store
identifiers or global variables as strings and resolve them on your simulation function. |
a = list("cos", [1.1 2]) b = var2vec(a) | ![]() | ![]() |
--> a = list("cos", [1.1 2]) a = (1) = "cos" (2) = [1.1,2] --> b = var2vec(a) b = 15. 2. 10. 2. 1. 1. 1. 0. 1. 2. 1. 2. 0. 1.1 2.