14
14
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="string" xml:lang="en">
16
<refname>string</refname>
17
<refpurpose>conversion to string</refpurpose>
20
<title>Calling Sequence</title>
22
[out, in, text] = string(x)
26
<title>Arguments</title>
31
<para>Boolean, complex, real, integer, polynomial matrix, implicit
32
size, library or function
39
<title>Description</title>
40
<para>converts a matrix into a matrix of strings.</para>
42
If <literal>x</literal> is a function <literal>[out, in, text] =
45
returns three vectors strings : <literal>out</literal>
46
is the vector of output variables, <literal>in</literal> is the vector of
47
input variables, and <literal>text</literal> is the (column) vector of the
48
source code of the function.
51
If <literal>x</literal> is a <literal>lib</literal> variable
52
(library), text is a character string column vector. The first element
53
contains the path of library file and the other the name of functions it
57
Character strings are defined as <literal>'string'</literal>
58
(between quotes) or <literal>"string"</literal> (between doublequotes);
59
matrices of strings are defined as usual constant matrices.
62
Concatenation of strings is made by the <literal>+</literal>
65
<para>For complex, real, integer, polynomial matrix
66
<literal>string</literal> output is managed by <link linkend="format">format</link> function (see examples).
70
<title>Examples</title>
71
<programlisting role="example">string(rand(2, 2))
73
deff("y = mymacro(x)", "y = x + 1")
74
[out, in, text] = string(mymacro)
76
disp("Result is " + string(x));
78
disp("/" + string(~%t) + "/");
79
disp("/" + string(%i+1) + "/");
80
disp("/" + string(int16(-123)) + "/");
81
disp("/" + string(1 + %s + %s^3) + "/");
94
<refsection role="see also">
95
<title>See Also</title>
96
<simplelist type="inline">
98
<link linkend="part">part</link>
101
<link linkend="length">length</link>
104
<link linkend="quote">quote</link>
107
<link linkend="evstr">evstr</link>
110
<link linkend="execstr">execstr</link>
113
<link linkend="strsubst">strsubst</link>
116
<link linkend="strcat">strcat</link>
119
<link linkend="strindex">strindex</link>
122
<link linkend="sci2exp">sci2exp</link>
125
<link linkend="format">format</link>
130
<title>History</title>
133
<revnumber>5.4.0</revnumber>
134
<revremark>implicit size type managed as input argument.</revremark>
16
<refname>string</refname>
17
<refpurpose>conversion to string</refpurpose>
20
<title>Calling Sequence</title>
22
[out, in, text] = string(x)
26
<title>Arguments</title>
31
<para>Boolean, complex, real, integer, polynomial matrix, implicit
32
size, library or function
39
<title>Description</title>
40
<para>converts a matrix into a matrix of strings.</para>
42
If <literal>x</literal> is a function <literal>[out, in, text] =
45
returns three vectors strings : <literal>out</literal>
46
is the vector of output variables, <literal>in</literal> is the vector of
47
input variables, and <literal>text</literal> is the (column) vector of the
48
source code of the function.
51
If <literal>x</literal> is a <literal>lib</literal> variable
52
(library), text is a character string column vector. The first element
53
contains the path of library file and the other the name of functions it
57
Character strings are defined as <literal>'string'</literal>
58
(between quotes) or <literal>"string"</literal> (between doublequotes);
59
matrices of strings are defined as usual constant matrices.
62
Concatenation of strings is made by the <literal>+</literal>
65
<para>For complex, real, integer, polynomial matrix
66
<literal>string</literal> output is managed by <link linkend="format">format</link> function (see examples).
70
<title>Examples</title>
71
<programlisting role="example">string(rand(2, 2))
73
deff("y = mymacro(x)", "y = x + 1")
74
[out, in, text] = string(mymacro)
76
disp("Result is " + string(x));
78
disp("/" + string(~%t) + "/");
79
disp("/" + string(%i+1) + "/");
80
disp("/" + string(int16(-123)) + "/");
81
disp("/" + string(1 + %s + %s^3) + "/");
94
<refsection role="see also">
95
<title>See Also</title>
96
<simplelist type="inline">
98
<link linkend="part">part</link>
101
<link linkend="length">length</link>
104
<link linkend="quote">quote</link>
107
<link linkend="evstr">evstr</link>
110
<link linkend="execstr">execstr</link>
113
<link linkend="strsubst">strsubst</link>
116
<link linkend="strcat">strcat</link>
119
<link linkend="strindex">strindex</link>
122
<link linkend="sci2exp">sci2exp</link>
125
<link linkend="format">format</link>
130
<title>History</title>
133
<revnumber>5.4.0</revnumber>
134
<revremark>implicit size type managed as input argument.</revremark>