addPublishedModelArtifact
R2026bDescription
addPublishedModelArtifact(
adds build artifacts or supplemental files to the published model specified by
pubmdl,Name=Value)pubmdl. You must specify at least one of the
SupportedFunctionality or SupplementalFiles
name-value arguments.
Examples
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
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
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)