Main Content

RTW.BlockProperty

Create a block property specification for a block replacement entry

Since R2024a

    Description

    example

    prop = RTW.BlockProperty(Name,Value) creates a block property that has the specified property name and value. Adding the property to an RTW.TflBlockEntry object specifies the property setting for the entry to match during code replacement.

    Examples

    collapse all

    This example shows how to create a block replacement entry that replaces code from Discrete FIR Filter blocks that use the direct form filter structure.

    Create a block replacement entry for the Discrete FIR Filter block.

    entry = RTW.TflBlockEntry;
    entry.Key = 'DiscreteFir';

    Create a block property that specifies the property FilterStructure and the value Direct form.

    prop = RTW.BlockProperty('FilterStructure', 'Direct form');

    Add the block property to the block replacement entry.

    addBlockProperty(entry,prop);

    When you use the block replacement entry in a code replacement table, the entry matches Discrete FIR Filter blocks that have FilterStructure set to Direct form.

    Input Arguments

    collapse all

    Name of the block property to match during code replacement, specified as a string. The property can be a dialog property or an algorithm property of the block. To find the available dialog properties of a block, click the block in the model and enter get_param(gcb, 'DialogParameters') at the command line. To find the available algorithm properties of a block, click the block in the model and enter get_param(gcb, 'AlgorithmParameters') at the command line.

    Example: 'FilterStructure'

    Data Types: string

    Property value to match during code replacement, specified as a string. To find the value of a property for a block, click the block in the model and enter get_param(gcb, PropertyName) at the command line.

    Example: 'Direct form'

    Data Types: string

    Output Arguments

    collapse all

    Handle to the created block property. Add the block property to a block replacement entry by specifying the handle as an input to the addBlockProperty method.

    Version History

    Introduced in R2024a