execstr

Execute Nelson code in strings.

📝 Syntax

  • execstr(str)

  • execstr(str, 'nocatch')

  • bSuccess = execstr(str, 'errcatch')

📥 Input argument

  • str - a string: Nelson instruction to execute

📤 Output argument

  • 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.

🕔 History

Version
📄 Description

1.0.0

initial version

Last updated

Was this helpful?