Execute a string containing an instruction/expression
Expression: | When eval has to execute an expression then Scilab equivalent for eval is evstr |
---|
:
When eval is used with two inputs then an equivalent can be found in examples below.
Matlab Scilab
`eval`_('1+1')
`eval`_('x=1+1')
`eval`_('[d1,d2]=size(1)')
[d1,d2]=`eval`_('size(1)')
`eval`_('1+1','1+2')
`evstr`_("1+1")
x = `evstr`_("1+1")
`execstr`_("[d1,d2]=size(1)")
`execstr`_("[d1,d2]=size(1)")
if `execstr`_("1+1","errcatch") then `execstr`_("1+2");end