<< strindex Strings strings >>

Scilab Help >> Strings > string

string

conversion to string

Syntax

text = string(x)
[out, in, text] = string(SciFun)

Arguments

x

a boolean, complex, real, integer, polynomial matrix, an implicitlist (like 1:$), a library of functions in Scilab language.

SciFun

a function in Scilab language (type 13, not its name as a string).

Description

The string function converts a matrix x into a matrix of strings.

If SciFun is a function, [out,in,text] = string(SciFun) returns three vectors of strings:

If x is a lib variable (library), text is a character string column vector. The first element contains the path of library file and the other the name of functions it defines.

For any complex, real, integer, polynomial or rational input, the format of literal numbers output from string(..) is managed by the format function (see examples).

Note that string([]) returns [] (unchanged).

Examples

string(rand(2, 2))

deff("y = mymacro(x)", "y = x + 1")
[out, in, text] = string(mymacro)
x = 123.356;
disp("Result is " + string(x));

disp("/" + string(~%t) + "/");
disp("/" + string(%i+1) + "/");
disp("/" + string(int16(-123)) + "/");
disp("/" + string(1 + %s + %s^3) + "/");

string(corelib)

v = format();
disp(string(%pi))
format(24);
disp(string(%pi))
format(v(2))

string(1:4:$)

See also

History

VersionDescription
5.4.0 Input of implicitlist typeof accepted.

Report an issue
<< strindex Strings strings >>