This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Model Transformer Tasks

Use the Model Transformer tool to refactor a model to implement variants and eliminate eligible data store blocks. You can perform the steps in the Model Transformer all at once or one step at a time.

Transformations

Use the Model Transformer tool to create models that contain these transformations:

  • Replace qualifying modeling patterns with variant blocks.

  • Replace data store blocks with blocks that make data dependency explicit.

If you want to perform both transformations at once, for each step, specify the input parameters. Then, click the Run Selected Checks button. After you run each check, create new models with the transformations by clicking the Refactor Model buttons.

If you want to perform one transformation at a time, you can individually select the checks.

See Also

Transform the model to variant system

Click the Run This Check button to identify system constants for use in variant transformations and blocks that qualify for transformation into Variant Subsystem or Variant Source blocks. These transformations are possible:

  • If an If block connects to one or more If Action Subsystems and each If Action Subsystem has one outport, replace this modeling pattern with a subsystem and a Variant Source block.

  • If an If block connects to an If Action Subsystem that has no outport or two or more outports, replace this modeling pattern with a Variant Subsystem block.

  • If a Switch Case block connects to one or more Switch Case Action Subsystems and each Switch Case Action Subsystem has one outport, replace this modeling pattern with a subsystem and a Variant Source block.

  • If a Switch Case block connects to a Switch Case Action Subsystem that has no outport or two or more outports, replace this modeling pattern with a Variant Subsystem block.

  • Replace a Switch block with a Variant Source block.

  • Replace a Multiport Switch block that has two or more data ports with a Variant Source block.

A system constant is the control input or is part of an arithmetic expression that forms the control input to Multiport Switch or Switch blocks and the inputs to If or Switch Case blocks. The control input must be Constant blocks and some combination of blocks that form a supported MATLAB expression. In the Constant block parameters dialog box, the Constant value parameters are the system constants. In the transformed model, system constants are part of condition expressions in Variant Source or Variant Subsystem blocks.

Note

For some model patterns and settings, the Model Transformer cannot perform every one of the preceding transformations.

In the Result table, each modeling pattern is a hyperlink to the corresponding location in the model. If you do not want the Model Transformer to perform a transformation, clear the check box next to the qualifying pattern.

Click the Refactor Model button to create a model that contains the transformations. The transformed model is in the folder that has the prefix m2m plus the original model name.

See Also

Eliminate Data Store Blocks

Click the Run This Check button to identify Data Store Memory, Data Store Read, and Data Store Write blocks that qualify for elimination. Click the Refactor Model button to create a model that replaces these blocks with either a direct signal line, aDelay block, or a Merge block. The model is in the folder that has the prefix m2m plus the original model name.

Replacing these blocks improves model readability by making data dependency explicit. The Model Transformer can replace these data stores:

  • For signals that are not buses, if a Data Store Read block executes before a Data Store Write block, the tool replaces these blocks with a Delay block.

  • For signals that are not buses, if a Data Store Write block executes before a Data Store Read block, the tool replaces these blocks with a direct connection.

  • For bus signals, if the write to bus elements executes before the read of the bus, the tool replaces the Data Store Read and Data Store Write blocks with a direct connection and a Bus Creator block.

  • For bus signals, if the write to the bus executes before the read of bus elements, the tool replaces the Data Store Read and Data Store Write blocks with a direct connection and a Bus Selector block.

  • For conditionally executed subsystems, the tool replaces the Data Store Read and Data Store Write blocks with a direct connection and a Merge block.

The Model Transformer tool only eliminates local data stores that Data Store Memory blocks define. The tool does not eliminate global data stores. For the Data Store Memory block, on the Signal Attributes tab of the block parameters dialog box, the Data store name must resolve to Simulink signal object parameter must be cleared.

The Result table contains hyperlinks to the corresponding Data Store Memory, Data Store Read, and Data Store Write blocks. If you do not want the Model Transformer to perform a transformation, before clicking the Refactor Model button, clear the check box next to the Data Store Memory block.

See Also