Main Content

evalin

(Not recommended) Evaluate MuPAD expressions without specifying their arguments

evalin(symengine,...) is not recommended. Use equivalent Symbolic Math Toolbox™ functions that replace MuPAD® functions instead. For more information, see Compatibility Considerations.

Description

example

result = evalin(symengine,MuPAD_expression) evaluates the MuPAD expression MuPAD_expression, and returns result as a symbolic object. If MuPAD_expression throws an error in MuPAD, then this syntax throws an error in MATLAB®.

[result,status] = evalin(symengine,MuPAD_expression) lets you catch errors thrown by MuPAD. This syntax returns the error status in status and the error message in result if status is nonzero. If status is 0, result is a symbolic object; otherwise, it is a character vector.

Examples

Perform MuPAD Command

Compute the eigenvalues of the following matrix:

evalin(symengine,'linalg::eigenvalues(matrix([[x,y],[y,x]]))')
ans =
[x + y, x - y]

Input Arguments

collapse all

Character vector containing a MuPAD expression.

Output Arguments

collapse all

Computation result returned as a symbolic object or character vector containing a MuPAD error message.

Error status returned as an integer. If F with the arguments x1,...,xn executes without errors, the error status is 0.

Tips

  • Results returned by evalin can differ from the results that you get using a MuPAD notebook directly. The reason is that evalin sets a lower level of evaluation to achieve better performance.

  • evalin does not open a MuPAD notebook, and therefore, you cannot use this function to access MuPAD graphics capabilities.

Compatibility Considerations

expand all

Not recommended starting in R2018b

Introduced in R2008b