Documentation Center

  • Trial Software
  • Product Updates

evalin

Evaluate MuPAD expressions without specifying their arguments

Syntax

result = evalin(symengine,MuPAD_expression)
[result,status] = evalin(symengine,MuPAD_expression)

Description

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

Input Arguments

MuPAD_expression

String containing a MuPAD expression.

Output Arguments

result

Symbolic object or string containing a MuPAD error message.

status

Integer indicating the error status. If MuPAD_expression executes without errors, the error status is 0.

Examples

Compute the discriminant of the following polynomial:

evalin(symengine,'polylib::discrim(a*x^2+b*x+c,x)')
ans =
 b^2 - 4*a*c
 

Try using polylib::discrim to compute the discriminant of the following nonpolynomial expression:

[result, status] = evalin(symengine,'polylib::discrim(a*x^2+b*x+c*ln(x),x)')
result =
Error: An arithmetical expression is expected. [normal]

status =
     2

Alternatives

feval lets you evaluate MuPAD expressions with arguments. When using feval, you must explicitly specify the arguments of the MuPAD expression.

More About

expand all

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.

See Also

| |

Related Examples

Was this topic helpful?