Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Strings > string


conversion to string


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



a boolean, complex, real, integer, polynomial matrix, an implicit size, a library or a function.


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

If x is a function [out, in, text] = string(x) returns three vectors of strings: out is the vector of output variables, in is the vector of input variables, and text is the (column) vector of the source code of the function.

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.

Character strings are defined as 'string' (between quotes) or "string" (between doublequotes); matrices of strings are defined as usual constant matrices.

Concatenation of strings is made by the + operation.

For complex, real, integer, polynomial matrix string output is managed by format function (see examples).

Note that string([]) returns [].


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) + "/");


v = format();


See also

  • part — Extraction of characters from strings
  • length — length of object
  • quote — (') transpose operator, string delimiter
  • evstr — evaluates Scilab expressions and concatenates their results
  • execstr — execute Scilab code in strings
  • strsubst — substitute a character string by another in a character string
  • strcat — concatenates character strings
  • strindex — search position of a character string in an other string
  • sci2exp — converts an expression to a string
  • format — set the default output format of decimal numbers


5.4.0 implicit size type managed as input argument.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:51 CET 2018