Main Content

Simplify Model for Targeted Analysis of Complex Models Using Model Slicer Tool

You can simplify simulation, debugging, and formal analysis of large, complex models by focusing on areas of interest in your model. After highlighting a portion of your model using the Model Slicer, you can generate a simplified standalone model. The simplified model contains the blocks and dependency paths in the highlighted portion. Apply changes to the simplified standalone model based on simulation, debugging, and formal analysis, and then apply these changes back to the original model.

  1. The example model sldemo_mdlref_basic contains three instances of the model sldemo_mdlref_counter. To open the model, at the MATLAB® command prompt, enter:

    openExample('sldemo_mdlref_basic');

  2. To open the Model Slicer Manager, on the Model Verification, Validation, and Test section of the Apps tab, click Model Slicer.

  3. In the Model Slice Manager, click the arrow to expand the Slicer configuration list.

  4. Set the slice properties:

    • Name: Slice1

    • Color: Magenta square from Model Slice Manager (magenta)

    • Signal Propagation: upstream

    Model Slicer can also highlight the constructs downstream of or bidirectionally from a block in your model, depending on which direction you want to trace the signal propagation.

  5. Add CounterC as a starting point. In the model, right-click CounterC and select Model Slicer > Add as Starting Point.

    Model Slice Manager with a signal propagation starting point at CounterC

    The Model Slicer now highlights the upstream constructs that affect CounterC.

    The model sldemo_mdlref_basic with upstream constructs highlighted in magenta

  6. In the Model Slice Manager, click Generate slice.

  7. In the Select File to Write dialog box, select the save location and enter a model name. The simplified standalone model contains the highlighted model items.

    The simplified standalone model that contains only CounterC and the upstream constructs

  8. To remove highlighting from the model, close the Model Slice Manager.

You can now analyze the simplified standalone model and apply any changes to the source model.

Related Topics