Contents

slreplace_mux

Replace Mux blocks used to create buses with Bus Creator blocks

Syntax

[muxes, uniqueMuxes, uniqueBds] = slreplace_mux('model')
[muxes, uniqueMuxes, uniqueBds] = slreplace_mux('model', reportonly)

Description

[muxes, uniqueMuxes, uniqueBds] = slreplace_mux('model') reports all Mux blocks that create buses in model and in libraries referenced by model. A signal created by a Mux block is a bus if the signal meets either or both of the following conditions:

  • A Bus Selector block individually selects one or more of the signal's elements (as opposed to the entire signal).

  • The signal's components have different data types, numeric types (complex or real), dimensionality, storage classes, or sampling modes.

Before running this command in any form, you should set the Mux blocks used to create bus signals connectivity diagnostic to warning or none. See Connectivity Diagnostics Overview for more information.

[muxes, uniqueMuxes, uniqueBds] = slreplace_mux('model', reportonly) is equivalent to [muxes, uniqueMuxes, uniqueBds] = slreplace_mux('model') if reportonly is true.

If reportonly is false, the function reports all Mux blocks that create buses in model and in libraries referenced by model, and replaces all such Mux blocks with Bus Creator blocks. The function saves the model, if changed, and saves and closes any changed library. You should make a backup copy of your model and libraries before using this form of the command.

Input Arguments

model

The model for which slreplace_mux is to report and optionally replace muxes used as buses.

reportOnly

Whether to just generate a report (true) or also change the model(s) (false).

Default: true

Output Arguments

muxes

All Mux blocks used as Bus Creators in the model and in libraries referenced by the model

uniqueMuxes

All Mux blocks used as Bus Creators in the model and in libraries referenced by the model, except blocks in the model that are copies of blocks in libraries

uniqueBds

All models and libraries that use Mux blocks as Bus Creators

See Also

|

Was this topic helpful?