toString

Convert a real vector in to a string representation

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

Syntax

Vectors.toString(v);
Vectors.toString(v,name="",significantDigits=6);

Description

The function call "Vectors.toString(v)" returns the string representation of vector v. With the optional arguments "name" and "significantDigits" a name and the number of the digits are defined. The default values of "name" and "significantDigits" are "" and 6 respectively. If name=="" (empty string) then the prefix "<name> =" is left out at the output-string.

Example

v = {2.12, -4.34, -2.56, -1.67};
toString(v);
                       // = "
                       //           2.12
                       //          -4.34
                       //          -2.56
                       //          -1.67"
toString(v,"vv",1);
                       // = "vv =
                       //           2
                       //          -4
                       //          -3
                       //          -2"

See also

Matrices.toString,

Syntax

s = toString(v, name, significantDigits)

Inputs (3)

v

Type: Real[:]

Description: Real vector

name

Default Value: ""

Type: String

Description: Independent variable name used for printing

significantDigits

Default Value: 6

Type: Integer

Description: Number of significant digits that are shown

Outputs (1)

s

Default Value: ""

Type: String