Main Content

MathWorks.MATLAB.Types.RunOptions

.NET class to specify options for MATLAB function evaluation

Since R2022b

Description

Use a .NET RunOptions object to pass execution parameters when calling MATLAB functions from .NET. The options specify whether to run synchronously, where to direct output streams, and how to return arguments.

Class Details

Namespace:

MathWorks.MATLAB.Types

Creation

RunOptions(output, error, nargout, async, cancelToken); creates an instance of RunOptions with optional parameters set by the corresponding property name.

Properties

Output

Output stream, specified as:

  • null—Use default value Console.Out.

  • TextWriter.Null—Ignore standard output.

  • TextWriter—Store output in TextWriter object.

Default value is Console.Out.

Error

Error stream, specified as:

  • null—Use default value Console.Error.

  • TextWriter.Null—Ignore error messages.

  • TextWriter—Store errors in TextWriter object.

Default value is Console.Error.

Nargout

Number of output arguments, specified as int. Default value is 1.

Async

Whether to evaluate asynchronously, specified as true or false. Default value is false.

CancelToken

Cancel token for asynchronous evaluation, specified as CancellationToken. Default value is CancellationToken.None,

Version History

Introduced in R2022b