This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Simulink subsystem block for filter




realizemdl(FiltObject) generates a model of the filter object FiltObject in a Simulink® subsystem block using sum, gain, and delay blocks from Simulink. The properties and values of FiltObject define the resulting subsystem block parameters.

realizemdl requires Simulink. To accurately realize models of quantized filters, use Fixed-Point Designer™.

realizemdl(FiltObject,Name,Value) generates the model forFiltObject with the associated Name,Value pairs, and any other values you set in FiltObject.


Subsystem filter blocks that you use realizemdl to create support sample-based input and output only. You cannot input or output frame-based signals with the block.

Using the optional propertyname/propertyvalue pairs lets you control more fully the way the block subsystem model gets built, such as where the block goes, what the name is, or how to optimize the block structure. Valid properties and values for realizemdl are listed in this table, with the default value noted and descriptions of what the properties do.

Property Name

Property Values



'current' (default), 'new' or SubsystemName

Specify whether to add the block to your current Simulink model or create a new model to contain the block. If you provide the name of a current subsystem in SubsystemName, realizemdl adds the new block to the specified subsystem.


'filter' (default)

Provides the name for the new subsystem block. By default the block is named 'filter'. To enter a name for the block, set propertyvalue to the name of your choice, enclosed in single quotes.


'off' (default) or 'on'

Specify whether to map the coefficients of the filter to the ports of the block.


'off' (default) or 'on'

Specifies whether to apply the current filter states to the realized model. This lets you save states from a filter object you may have used or configured in a specific way. The default setting of 'off' means the states are not transferred to the model. Setting the property to 'on' preserves the current filter states in the realized model.


'off' or 'on'

Specify whether to overwrite an existing block with the same name or create a new block.


'off' (default) or 'on'

Specify whether to remove zero-gain blocks.


'off' (default) or 'on'

Specify whether to replace unity-gain blocks with direct connections.


'off' (default) or 'on'

Specify whether to replace negative unity-gain blocks with a sign change at the nearest sum block.


'off' (default) or 'on'

Specify whether to replace cascaded chains of delay blocks with a single integer delay block to provide an equivalent delay.


{'Num'} (default FIR),{'Num','Den'} (default direct form IIR),{'Num','Den','g'} (default IIR SOS), {'K'} (default form lattice)

Specify the coefficient variable names as character vectors in a cell array.MapCoeffsToPorts must be set to 'on' for this property to apply.


'columnsaschannels' (default), 'elementsaschannels' , or 'inherited'

Specify frame-based ('columnsaschannels') or sample-based ('elementsaschannels') processing.

The Inherited (this choice will be removed - see release notes) option will be removed in a future release.


'enforcesinglerate' (default) or 'allowmultirate'

Specify how the block adjusts the rate at the output to accommodate the reduced number of samples. This parameter applies only when InputProcessing is 'columnsaschannels'.


collapse all

Create a lowpass Butterworth filter and realize its Simulink® model with coefficients mapped to ports. Call the filter NewFilter.

[b,a] = butter(4,.25);
d = dfilt.df1(b,a);

In this case, the filter is an IIR filter with a direct form II second-order sections structure. Setting MapCoeffstoPorts to 'on' exports the numerator coefficients, the denominator coefficients, and the gains to the MATLAB® workspace using the default variable names Num, Den, and g. Each column of Num and Den represents one second-order section. You can modify the filter coefficients directly in the MATLAB workspace providing tunability to the realized Simulink model.

Introduced in R2009b

Was this topic helpful?