Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - English


var2vec

Transform a scilab variable into a vector of double

Syntax

vec = var2vec(var)

Arguments

var
Can be a Double, Integer, Boolean, String or List Scilab object.

vec
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.

Examples

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.

See also

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

Copyright (c) 2022-2024 (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:
Thu Oct 24 11:13:15 CEST 2024