Main Content

matlab.system.display.Section Class

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.

Class Attributes

Sealed
true

For information on class attributes, see Class Attributes.

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) creates the property group section propGroup and sets properties for the property group according to the System object obj.

propGroup = matlab.system.display.Section(sysObj,Name,Value) creates the property group section paramGroup and sets properties for the property group according to the System object obj 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:

  • Title — System object name

  • PropertyList — All public properties of the System object

    You can specify this argument as mfilename("class").

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:

  • 'Property' — Section title comes from Title property for property group.

  • 'Auto' — Section title comes from System object specified as input argument for constructor.

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:

  • Hidden properties

  • Abstract properties

  • Private properties

  • Properties with protected access

  • Discrete states

  • Continuous states

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 the matlab.system.display.SectionType enumeration class.

  • matlab.system.display.SectionType.tab — Creates a tab for the property group within the Block Parameters dialog box.

  • matlab.system.display.SectionType.panel — Creates a panel for the property group within the Block Parameters dialog box.

  • matlab.system.display.SectionType.group — Creates a titled group for the property group within the Block Parameters dialog box.

  • matlab.system.display.SectionType.collapsiblepanel — Creates a collapsible panel for the property group within the Block Parameters dialog box.

Attributes:

GetAccess
public
SetAccess
public

Data Types: matlab.system.display.SectionType

Option to control align prompts within containers, specified as logical true (1) or logical false (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