functiontoString
Convert a matrix into its string representation
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
Matrices.toString(A); Matrices.toString(A, name="", significantDigits=6);
Description
The function call "Matrices.toString(A)" returns the
string representation of matrix A.
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=="" then the
prefix "<name> =" is left out.
Example
A = [2.12, -4.34; -2.56, -1.67]; toString(A); // = " // 2.12 -4.34 // -2.56 -1.67"; toString(A,"A",1); // = "A = // 2 -4 // -3 -2"
See also
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | M | Real matrix | |
| String | name | "" | Independent variable name used for printing |
| Integer | significantDigits | 6 | Number of significant digits that are shown |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | s | "" | String expression of matrix M |