eval

eval( expression ) evaluates the MATLAB ® code in expression .

Note

Security Considerations: When calling eval with untrusted user input, validate the input to avoid unexpected code execution. Examples of untrusted user input are data coming from a user you might not know or from a source you have no control over. If you need to address this concern, consider these approaches:

Performance Considerations: In most cases, using the eval function is also less efficient than using other MATLAB functions and language constructs, and the resulting code can be more difficult to read and debug. Consider using an alternative to eval .

[ output1. outputN ] = eval( expression ) returns the outputs from expression in the specified variables.