Quantcast

Documentation Center

  • Trial Software
  • Product Updates

evalc

Evaluate MATLAB expression with capture

Syntax

T = evalc(expression)
[T,output1,...,outputN] = evalc(expression)

Description

T = evalc(expression) is the same as eval(expression) except that anything that would normally be written to the command window, except for error messages, is captured and returned in the character array T (lines in T are separated by \n characters).

[T,output1,...,outputN] = evalc(expression) is the same as [output1,...,outputN] = eval(expression) except that any output is captured into T.

Input Arguments

expression

String that contains a valid MATLAB® expression.

To include a numeric value in the expression, convert it to a string with int2str, num2str, or sprintf.

Output Arguments

T

Output normally written to the command window during the evaluation of expression, except for error messages, returned in a character array. The lines in T are separated by \n characters.

output1,...,outputN

Outputs from the evaluated expression.

More About

expand all

Tips

When you are using evalc, functions diary, more, and input are disabled.

See Also

| | | | | |

Was this topic helpful?