matlab.system.display.Section - Create property group section in Block Parameters dialog box for MATLAB System

        block - MATLAB ([original](https://in.mathworks.com/help/simulink/slref/matlab.system.display.section-class.html)) ([raw](?raw))

Namespace: matlab.system.display

Create property group section in Block Parameters dialog box for MATLAB System block

Description

Use the matlab.system.display.Section class inside the getPropertyGroupsImpl method to add a property group section to the Block Parameters dialog box for a MATLAB System block. You can use the property group to set properties on the System object™ for the block.

Creation

Description

propGroup = matlab.system.display.Section(`Name,Value`) creates the property group section propGroup in the Block Parameters dialog box for a MATLAB System block and sets properties for the property group according to one or more name-value arguments.

example

propGroup = matlab.system.display.Section([sysObj](#mw%5F3646f94c-b2b6-482b-a250-f067e052b3c0)) creates the property group section propGroup and sets properties for the property group according to the System objectobj.

propGroup = matlab.system.display.Section([sysObj](#mw%5F3646f94c-b2b6-482b-a250-f067e052b3c0),`Name,Value`) creates the property group section paramGroup and sets properties for the property group according to the System objectobj and one or more name-value arguments. Properties you specify using name-value arguments override the property values that come from the System object.

Input Arguments

expand all

System object for MATLAB System block, specified as a System object.

When you specify the System object as an input argument, these property values for the property group come from the System object:

Properties

expand all

Property group title, specified as a string or a character vector. By default, the title for the section in the Block Parameters dialog box is an empty character vector ('').

Example: "My Property Group"

Attributes:

GetAccess public
SetAccess public

Data Types: string | char

Source for property group title, specified as one of these options:

Attributes:

GetAccess public
SetAccess public

Data Types: string | char

Property group description, specified as a string or a character vector. By default, the description is an empty character vector ('').

The description appears in the Block Parameters dialog box above any properties in the section.

Example: "My property group description."

Attributes:

GetAccess public
SetAccess public

Data Types: string | char

Properties available to set within property group, specified as a cell array of character vectors that each define the name of a property. By default, the property list is an empty cell array ({}).

When you specify a System object as an input argument for the constructor, the property list is set to all public properties on the System object unless you override the setting by also specifying the property list as a name-value argument.

These types of properties are not available for display in the Block Parameters dialog box or in the summary that appears in the MATLAB® Command Window:

You cannot display dependent properties in the Block Parameters dialog box but these properties do show in the System object summary you view in the MATLAB Command Window.

Example: {'Property1' 'Property2'}

Attributes:

GetAccess public
SetAccess public

Data Types: cell

Type of section for property group, specified as a member of thematlab.system.display.SectionType enumeration class.

Attributes:

GetAccess public
SetAccess public

Data Types: matlab.system.display.SectionType

Option to control align prompts within containers, specified as logicaltrue (1) or logicalfalse (0).

Attributes:

GetAccess public
SetAccess public

Data Types: logical

Examples

collapse all

Define two property groups in your class definition file by specifying their titles and property lists.

classdef MultipleGroupsWithSection < matlab.System properties StartValue = 0 EndValue = 10 Threshold = 1 end

properties(Nontunable)
    UseThreshold (1,1) logical = true
end

methods (Static, Access = protected)
    function groups = getPropertyGroupsImpl
        valueGroup = matlab.system.display.Section(...
            "PropertyList",{'StartValue','EndValue'},...
            "SectionType", matlab.system.display.SectionType.tab);

       thresholdGroup = matlab.system.display.Section(...
            "PropertyList",{'Threshold','UseThreshold'},...
            "SectionType", matlab.system.display.SectionType.tab);
       
       group1 = matlab.system.display.SectionGroup(...,
           "Title","Value parameters",...
           'Sections',valueGroup,...
           'Type',matlab.system.display.SectionType.tab);

       group2 = matlab.system.display.SectionGroup(...,
           "Title","Threshold parameters",...
           'Sections',thresholdGroup,...
           'Type',matlab.system.display.SectionType.tab);

       groups = [group1, group2];
    end
end

end

When you specify the System object in the MATLAB System block, the Block Parameters dialog box for the block has two tabs that correspond to the two property groups.

The Block Parameters dialog box for the MATLAB System block has a header followed by a section with two tabs. The tab labeled Value parameters is selected and shows text fields that set the Start Value and End Value parameters for the System object.

Version History

Introduced in R2013b