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 - 日本語 - Русский

Please note that the recommended version of Scilab is 6.1.1. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab help >> Strings > evstr


evaluation of expressions

Calling Sequence

H = evstr(Z)
[H, ierr] = evstr(Z)



a matrix of character strings M or list(M,Subexp)


a matrix of character strings.


a vector of character strings.


a matrix.


an integer, error indicator.


Returns the result of the evaluation of the matrix of character strings M. Each element of the matrix must define a valid Scilab expression.

If the evaluation of M expression leads to an error, the single return value version, H = evstr(M), raises the error as usual. The two return values version, [H,ierr] = evstr(M), on the other hand, produces no error, but returns the error number in ierr.

If Z is a list, Subexp is a vector of character strings, that defines subexpressions which are evaluated before evaluating M. These subexpressions must be referred to as %(k) in M, where k is the subexpression's index in Subexp.

evstr('a = 1') is not valid (use execstr instead).

Nan, NaN will be interpreted as %nan.

Inf will be interpreted as %inf.


a = 1; b = 2;
Z = ['a', 'b'] ;

Z = list(['%(1)','%(1)-%(2)'],['a+1','b+1']);
evstr('NaN'), evstr('Inf')

//The two return values version
[H, ierr] = evstr(Z) // no error
Z = ['a', 'b', 'c'] ;// the variable c is undefined
[H, ierr] = evstr(Z) // error 4: Undefined variable: c

See Also

  • execstr — execute Scilab code in strings
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:36:23 CEST 2013