Contenu principal

addPublishedModelArtifact

R2026b

Add artifact to published model

Since R2026b

Description

addPublishedModelArtifact(pubmdl,Name=Value) adds build artifacts or supplemental files to the published model specified by pubmdl. You must specify at least one of the SupportedFunctionality or SupplementalFiles name-value arguments.

example

Examples

collapse all

Suppose you publish a model with the System target file model configuration parameter set to grt.tlc. You want the published model to support both grt.tlc and ert.tlc.

To add support for ert.tlc, set the System target file parameter of the source model to ert.tlc. If the source model references other models, also set their System target file parameters to ert.tlc.

set_param("mymodel",SystemTargetFile="ert.tlc");

To add the relevant build artifacts to the published model, use the SupportedFunctionality name-value argument. The added artifacts reflect the current configuration of the source model.

addPublishedModelArtifact("mymodel.slxp",SupportedFunctionality="model-reference-code-generation")

Models that reference the published model can now generate code using either the grt.tlc or ert.tlc system target file.

To add a file to a published model, use the SupplementalFiles name-value argument.

addPublishedModelArtifact("mymodel.slxp",SupplementalFiles="readme.md")

The published model now contains this file. A recipient can unpack this file by using the unpackPublishedModelSupplementalFiles function.

Input Arguments

collapse all

Published model filename, specified as a string or character vector.

Specify the published model filename with the .slxp extension.

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: addPublishedModelArtifact("mymodel.slxp",SupportedFunctionality="model-reference-code-generation")

Custom tag for traceability, specified as a string or character vector.

Provide a custom tag that helps you trace the added functionality to a commit or job number. The tag supports printable and white space characters, as defined by isstrprop.

The tag appears in the published model report and slxpinfo function output.

Data Types: char | string

Published model target type, specified as one of these values:

  • "model-reference-simulation" — A model that references the published model can run in normal, accelerator, or rapid accelerator mode.

  • "model-reference-code-generation" — A model that references the published model can generate C and C++ code.

For the supported functionality you select, the published model contains the relevant build artifacts and dependencies. Simulink® uses these build artifacts and does not rebuild them.

Tunable parameters for simulation, specified as "all-tunable", "none-tunable", or a string or cell array of character vectors.

  • "all-tunable" — All tunable global parameters used by the model become tunable instance parameters of the published model.

  • "none-tunable" — No tunable global parameters used by the model become tunable instance parameters of the published model. The published model uses the parameter values at the time of publishing.

  • String or cell array of character vectors — The specified tunable global parameters used by the model become tunable instance parameters of the published model.

Model arguments are inherently tunable. You do not need to specify the tunability of model arguments.

Data Types: char | string | cell

Option to preserve timestamps for traceability, specified as a numeric or logical 1 (true) or 0 (false).

  • false — When unpacking build artifacts from the published model, assign current file system timestamps so that the artifacts are treated as new. If you generate code and build it using your own makefile or compiler, timestamp-based incremental builds use the newly extracted build artifacts.

  • true — Preserve the original timestamps of build artifacts when unpacking them from the published model. This helps maintain traceability for verified build artifacts.

Data Types: logical

Verbose output display, specified as a numeric or logical 1 (true) or 0 (false). When set to true, the function displays detailed progress information during publishing.

Data Types: logical

Supplemental files to include in the published model, specified as a string, character vector, or cell array of character vectors. Each file must exist on disk.

Specify supplemental files such as instructions, test results, and code coverage reports. You do not need to specify automatically identified model dependencies, such as data dictionaries. Publishing automatically includes these files. For more information about model dependencies, see Model dependencies.

Data Types: char | string | cell

Version History

Introduced in R2026b