Main Content

sdo.EvaluateOptions

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

example

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.

Properties

expand all

Parallel computing option for sdo.evaluate, specified as one of the following:

  • false or 0 — Do not use parallel computing during cost function evaluation.

  • true or 1 — Use parallel computing during cost function evaluation.

    It is recommended that you also specify values for the EvaluatedModel, and ParallelFileDependencies, or ParallelPathDependencies properties, if needed.

You must install Parallel Computing Toolbox™ to enable parallel computing for the cost function evaluation.

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');

Version History

Introduced in R2014a