FUNCTION REFERENCE

eval

Run MATLAB code held in text.

Run MATLAB code held in text.

Syntax

eval(expression)

Syntax

eval(expression, catchExpression)

Syntax

x = eval(expression)

Runs the text in the current workspace, so variables it assigns stay. When

an output is requested, a text that is one expression returns its value and

the outer statement controls display. Otherwise, statements inside the text

control display, including their semicolons. With catchExpression, that text

runs instead when the first one fails.

Example

eval('y = 2 + 3;'); y   % 5

Differences from MATLAB: function definitions are rejected.

Syntax errors other than an incomplete statement

keep MatRust's parser wording after "Error: ".

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.