Main Content

slxcunpack

Unpack simulation and code generation targets from Simulink cache file

Since R2020b

Description

example

info = slxcunpack(filename) unpacks the simulation and code generation artifacts from the specified Simulink® cache file for the current platform and MATLAB® release. Code generation artifacts must apply to the current system target file and folder configuration.

When using this function, consider these limitations:

  • Do not use this function during model callbacks, model updates, simulation, or code generation. This function loads the model associated with the Simulink cache file.

  • Do not use this function as part of asynchronous functions, such as parfor and parfeval.

  • The contents of the Simulink cache file might be out of date. Simulation and code generation can update the artifacts on disk and in the Simulink cache file.

example

info = slxcunpack(filename,Name,Value) specifies additional options using one or more name-value pair arguments.

Examples

collapse all

Suppose you have this setup:

  • R2020b MATLAB release

  • 64-bit Windows® operating system

  • grt.tlc system target file — For more information, see System target file (Simulink Coder).

  • Model specific code generation folder structure — For more information, see Code generation folder structure.

And you have two Simulink cache files:

  • topmodel.slxc is a Simulink cache file for the top model in a model hierarchy.

  • refmodel.slxc is a Simulink cache file for the only referenced model in the model hierarchy.

To unpack the simulation and code generation artifacts that correspond to your setup from the Simulink cache file, you would enter:

info = slxcunpack('topmodel.slxc')
info =

  5×4 table

      Model       Release     Platform                     Target                 
    __________    ________    ________    ________________________________________

    "topmodel"    "R2020b"    "win64"     "Rapid accelerator target"
    "topmodel"    "R2020b"    "win64"     "Accelerator target"                    
    "topmodel"    "R2020b"    "win64"     "grt | Top model | Model specific"      
    "refmodel"    "R2020b"    "win64"     "Model reference simulation target"     
    "refmodel"    "R2020b"    "win64"     "grt | Model reference | Model specific"

The returned table lists the artifacts that the function unpacks into the Simulation cache folder and Code generation folder.

Suppose you have this setup:

  • R2020b MATLAB release

  • 64-bit Windows operating system

And you have two Simulink cache files:

  • topmodel.slxc is a Simulink cache file for the top model in a model hierarchy.

  • refmodel.slxc is a Simulink cache file for the only referenced model in the model hierarchy.

To unpack the simulation artifacts that correspond to your setup from the Simulink cache file and display status messages, you would enter:

info = slxcunpack('topmodel.slxc','Target','Simulation','Verbose',true)
### Rapid accelerator target for 'topmodel': Unpacked.
### Accelerator target for 'topmodel': Unpacked.
### Model reference simulation target for 'refmodel': Unpacked.

info =

  3×4 table

      Model       Release     Platform                  Target               
    __________    ________    ________    ___________________________________

    "topmodel"    "R2020b"    "win64"     "Rapid accelerator target"         
    "topmodel"    "R2020b"    "win64"     "Accelerator target"               
    "refmodel"    "R2020b"    "win64"     "Model reference simulation target"

The returned table lists the artifacts that the function unpacks into the Simulation cache folder.

Input Arguments

collapse all

Name of the Simulink cache file, including the .slxc extension, specified as a character vector or string scalar.

Note

The Simulink cache file must be in the Simulation cache folder, which, by default, is the current working folder (pwd).

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: slxcunpack('model.slxc','Target','Simulation')

Type of target to unpack, specified as the comma-separated pair consisting of 'Target' and 'All', 'Simulation', or 'CodeGeneration'. If 'All', the function unpacks both simulation and code generation targets.

The unpacked simulation targets can be accelerator targets, rapid accelerator targets, and model reference simulation targets.

Data Types: char | string

Option to unpack referenced model targets, specified as the comma-separated pair consisting of 'UnpackReferencedModels' and true or false. If true, the function also unpacks the Simulink cache files that correspond to referenced models.

Data Types: logical

Option to display status messages, specified as the comma-separated pair consisting of 'Verbose' and true or false.

Data Types: logical

Output Arguments

collapse all

Unpacked Simulink cache file contents, returned as a MATLAB table.

Version History

Introduced in R2020b