Main Content

SLSlicerAPI.SLSlicer Class

Namespace: SLSlicerAPI

Class representing a set of Model Slicer functionality

Description

The SLSlicerAPI.SLSlicer class provides a set of methods to access Model Slicer functionality from the MATLAB command line. Use an instance of SLSlicerAPI.SLSlicer class to:

  • Activate or terminate slice simulation.

  • Add or remove starting point, exclusion point, constraints, slice component and configuration.

  • Highlight the functional dependencies.

  • Set time window and simulate slice.

  • Refine slice for dead logic analysis.

Creation

Description

example

slslicer(model) creates a Model Slicer configuration object for the model model by exposing the methods for invoking the Model Slicer.

slslicer(model, opts) creates a Model Slicer configuration object for the model model by using the options object opts, as defined by slsliceroptions.

Input Arguments

expand all

Name of the model whose Model Slicer options object you configure. slslicer uses the Model Slicer configurations associated with the model, as defined by slsliceroptions.

Data Types: string

Structure containing the options for the Model Slicer configuration. slsliceroptions defines the options object opts.

Data Types: struct

Properties

expand all

The name of the Model Slicer configuration.

A description of the Model Slicer configuration.

The direction of the dependency analysis.

The color of a functional dependency highlight.

The location of the slslicex file containing the dead logic data.

A flag for specifying whether the analysis should exclude elements of dead logic.

The location of the slslicex file containing simulation data.

A flag for specifying whether the analysis should use simulation time window information.

Model blocks or subsystems that you add as slice components.

Model elements that you add as constraints.

Model elements that you specify as exclusion points.

Model elements that you add as starting points.

Specify whether to inline model items inside sliced libraries within the sliced model and maintain the library links.

Specify whether to inline model items from the model referenced by the Model block within the sliced model and remove the Model block.

Specify whether to inline model elements inside sliced masked subsystems within the sliced model and retain the mask in the sliced model.

Specify whether to inline model items to the sliced model from the active variant and remove the variants.

Specify whether to inline contents of subsystem references in sliced models.

Expand trivial subsystem in sliced model and set subsystem boundary.

Retain root-level input and output ports in sliced model.

Retain signal observer, such as scopes, displays, and test condition blocks in the sliced model.

Methods

expand all

Examples

collapse all

Add a new starting point to the active Model Slicer configuration, and then highlight the model.

1. Open the sldvSliceClimateControlExample example model.

open_system('sldvSliceClimateControlExample');

2. Create a Model Slicer configuration object for the model by using slslicer.

obj = slslicer('sldvSliceClimateControlExample');

3. Activate the slice highlighting mode of Model Slicer to compile the model and prepare the model slice for dependency analysis.

activate(obj);
Consider turning on Fast Restart before launching Model Slicer for simulation based workflows. Do not show again.

4. Add the Out1 outport block as the starting point and highlight the model slice.

addStartingPoint(obj,'sldvSliceClimateControlExample/Out1');
highlight(obj);

The area of the model upstream of the starting point and which is active during simulation is highlighted.

5. Terminate the model highlighting mode and discard the analysis data.

terminate(obj);

Version History

Introduced in R2015b