execstr
Execute Nelson code in strings.
📝Syntax
execstr(str)
execstr(str, 'nocatch')
 bSuccess = execstr(str, 'errcatch')
📥Input Arguments
Parameter Description
str a string: Nelson instruction to execute
📤Output Arguments
Parameter Description
bSuccess a logical: true or false if command fails
📄Description

execstr executes Nelson instructions given in a string.

execstr(str, 'nocatch') is equivalent to execstr(str)

execstr can be used as alternative to try ... catch ... end block.

💡Examples
execstr('b = ''hello''; disp(b);')
This example will fail and returns an error message.
execstr('b = yyyy')
This example will fail and returns an error message.
execstr('b = yyyy', 'nocatch')
This example will not fail and return false.
r = execstr('b = yyyy', 'errcatch')
🔗See Also
run
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub