Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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

Character vector that contains a valid MATLAB® expression.

To include a numeric value in the expression, convert it to a character vector 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

collapse all

Tips

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

See Also

| | | | | |

Introduced before R2006a

Was this topic helpful?