Hauptinhalt

createExternalParametersAlternateSource

R2026b

Create alternate value source for published model external parameters

Since R2026b

Description

createExternalParametersAlternateSource(block) creates and assigns a data dictionary (.sldd) as the alternate value source for published model external parameters at the Model block specified by block. The Model block must reference a published model. The data dictionary uses the parameter values captured when the published model was created. The data dictionary filename is the published model filename with an _params suffix.

When you do not use an alternate value source, simulations use values from the original sources. These values can change after publishing. For example, values in the base workspace can change after publishing.

example

createExternalParametersAlternateSource(block,Filename=filename) specifies a custom filename for the data dictionary.

example

Examples

collapse all

To create an alternate value source for a published model, specify the name of a Model block that references the published model.

createExternalParametersAlternateSource("mymodel/Model")

The function creates a data dictionary that uses the published model filename with an _params suffix, for example, mypublishedmodel_params.sldd.

To specify a custom filename when you create an alternate value source, use the Filename argument.

createExternalParametersAlternateSource("mymodel/Model",Filename="custom_params.sldd")

The function creates a data dictionary with the specified name.

Input Arguments

collapse all

Model block, specified as a string, character vector, or numeric block handle. The block must be a Model block that references a published model that has at least one external parameter.

Data Types: string | char | double

Name of alternate value source file, specified as a string or character vector. The filename must have a .sldd extension and must not already exist. By default, the filename is the model name with a _params.sldd suffix.

Data Types: string | char

Tips

  • To specify an existing data dictionary as the alternate value source, set the ExternalParametersAlternateSource block parameter to the data dictionary filename.

  • To remove the alternate value source and use the original value sources, set the ExternalParametersAlternateSource block parameter to "".

Version History

Introduced in R2026b