Navigation

Operators and Keywords

Function List:

C++ API

: s = evalc (try)
: s = evalc (try, catch)

Parse and evaluate the string try as if it were an Octave program, while capturing the output into the return variable s.

If execution fails, evaluate the optional string catch.

This function behaves like eval, but any output or warning messages which would normally be written to the console are captured and returned in the string s.

The diary is disabled during the execution of this function. When system is used, any output produced by external programs is not captured, unless their output is captured by the system function itself.

s = evalc ("t = 42"), t
 ⇒ s = t =  42

 ⇒ t =  42

See also: eval, diary.

Package: octave