Main Content

sdo.EvaluateOptions

R2026b

Cost function evaluation options for sdo.evaluate

Description

Specify options such as evaluation error handling, display settings, and the use of parallel computing for cost function evaluations using sdo.evaluate.

Creation

Description

opt = sdo.EvaluateOptions creates an sdo.EvaluateOptions object and assigns default values to the properties.

example

opt = sdo.EvaluateOptions(Name=Value) creates an sdo.EvaluateOptions object and sets Properties using one or more name-value arguments. For example, UseParallel=1 specifies to use parallel computing during cost function evaluation.

example

Properties

expand all

Option to perform computations in parallel using a parallel pool of workers for sdo.evaluate, specified as one of these values:

  • "off" — Run in serial on the MATLAB® client.

  • "auto" — Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, run in serial on the MATLAB client.

  • "on" — Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, throw an error.

If you do not have a parallel pool open and automatic pool creation is enabled, MATLAB opens a pool using the default cluster profile. To enable parallel computing for the cost function evaluation, you must have Parallel Computing Toolbox™.

Before R2026b: To run in parallel, set UseParallel to true.

Handling of cost function evaluation error, specified as one of these values:

  • 'on' — sdo.evaluate stops when a cost function evaluation results in an error.

  • 'off' — sdo.evaluate continues when a cost function evaluation results in an error. sdo.evaluate returns the error using the info output argument.

Viewing of display messages for cost function evaluations, specified as one of the following values:

  • 'final' — Display only the final output.

  • 'off' — Display no output.

  • 'iter' — Display the output for each evaluation.

File dependencies to use during parallel evaluation, specified as a cell array of character vectors. Each character vector can specify either an absolute or relative path to a file. For example, {'C:\matlab\work\file1.m','C:\matlab\myProject\file2.m'}. These files are copied to the workers during parallel evaluation. Use sdo.getModelDependencies to find the dependencies of a Simulink® model.

Paths to dependencies to use during parallel evaluation, specified as a cell array of character vectors. For example, {'C:\matlab\work','C:\matlab\myProject'}. These path dependencies are temporarily added to the workers during parallel evaluation. Use sdo.getModelDependencies to find the dependencies of a Simulink model.

Name of Simulink model to be evaluated, specified as a character vector. For example, 'sldo_model1'.

Use this property to configure the model for parallel evaluation (UseParallel = true).

Examples

collapse all

Create an sdo.EvaluateOptions object.

opt = sdo.EvaluateOptions;

Specify handling of cost function evaluation error.

opt.StopOnEvaluateError = 'on';

Create an sdo.EvaluateOptions object to view output for each evaluation.

opt = sdo.EvaluateOptions('Display','iter');

Extended Capabilities

expand all

Version History

Introduced in R2014a

expand all