Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.1.0 - Português


var2vec

Transform a scilab variable into a vector of double

Syntax

vec = var2vec(var)

Arguments

  • var: input parameter. Can be a Double, Integer, Boolean, String or List Scilab object.

  • vec: output parameter. A vector of real numbers.

Description

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.

vec = var2vec(var)

Example

-->a = list("cos", [1.1 2])
a  =
a(1)
cos
a(2)
1.1    2.
-->b = var2vec(a)
b  =
15.
2.
10.
2.
1.
1.
1.
0.
1.
2.
1.
2.
0.
1.1
2.

See also

  • vec2var — Transform a vector of double into a scilab variable
Report an issue
<< standard_outputs scilab_utilities_functions vec2var >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon May 22 12:42:18 CEST 2023