Main Content

matlab.system.display.SectionGroup class

Package:matlab.system.display
Superclasses:

Section group for System objects

Syntax

matlab.system.display.SectionGroup(N1,V1,...Nn,Vn)
matlab.system.display.SectionGroup(Obj,...)

Description

matlab.system.display.SectionGroup(N1,V1,...Nn,Vn)creates a group for displaying System object™ properties and display sections created withmatlab.system.display.Section. You define such sections or properties using property Name-Value pairs (N,V). A section group can contain both properties and sections. You usematlab.system.display.SectionGroupto define section groups using thegetPropertyGroupsImplmethod. Section groups display as separate tabs in theMATLAB Systemblock. The available Section properties are:

  • Title— Group title. The default value is an empty character vector.

  • TitleSource— Source of group title. Valid values are'Property'and'Auto'. The default value is'Property', which uses the character vector from theTitleproperty. If theObjname is given, the default value isAuto, which uses theObjname. In the System object property display at the MATLAB®command line, you can omit the default "Main" title for the first group of properties by settingTitleSourceto'Auto'.

  • Description— Group or tab description that appears above any properties or panels. The default value is an empty character vector.

  • PropertyList— Group or tab property list as a cell array of property names. The default value is an empty array. If theObjname is given, the default value is all eligible display properties.

  • Sections— Group sections as an array of section objects. If theObjname is given, the default value is the default section for theObj.

  • Type— Container type. For example, tab, group, panel, and collapsible panel.

  • Row— Specify the row in which the containers need to be placed (current/new). You can specify the row using the enum class matlab.system.display.internal.Row.

  • AlignPrompts— Specify a boolean value to control align prompts within the containers.

matlab.system.display.SectionGroup(Obj,...)creates a section group for the specified System object (Obj) and sets the following property values:

  • TitleSource— Set to'Auto'.

  • Sections— Set tomatlab.system.display.Sectionobject forObj.

You can usemfilename(类)from within this method to get the name of the System object. If you set any Name-Value pairs, those property values override the default settings.

Examples

collapse all

Define in your class definition file two tabs, each containing specific properties. For this example, you use thematlab.system.display.SectionGroup,matlab.system.display.Section, andgetPropertyGroupsImplmethods.

classdefMultipleGroupsWithSectionGroup < matlab.System% MultipleGroupsWithTabs Customize block dialog with multiple tabs and parameter groups.% Public, tunable propertiesproperties%StartValue Start ValueStartValue = 0%EndValue End ValueEndValue = 10 Threshold = 1%BlockLimit LimitBlockLimit = 55end% Public Nontunableproperties(Nontunable)%IC1 First initial conditionIC1 = 0%IC2 Second initial conditionIC2 = 10%IC3 Third initial conditionIC3 = 100%UseThreshold Use thresholdUseThreshold(1,1) logical= trueendmethods(Static, Access = protected)functiongroups = getPropertyGroupsImpl% Section to always display above any tabs.alwaysSection = matlab.system.display.Section(...'Title','','PropertyList',{'BlockLimit'});% Group with no sectionsinitTab = matlab.system.display.SectionGroup(...'Title','Initial conditions',...'PropertyList',{'IC1','IC2','IC3'},...'GroupType', matlab.system.display.SectionType.group);% Section for the value parametersvalueSection = matlab.system.display.Section(...'Title','Value parameters',...'PropertyList',{'StartValue','EndValue'},...'SectionType', matlab.system.display.SectionType.collapsiblepanel);% Section for the threshold parametersthresholdSection = matlab.system.display.Section(...'Title','Threshold parameters',...'PropertyList',{'Threshold','UseThreshold'},...'SectionType', matlab.system.display.SectionType.collapsiblepanel);% Group with two sections: the valueSection and thresholdSection sectionsmainTab = matlab.system.display.SectionGroup(...'Title','Main',...'Sections',[valueSection,thresholdSection],...'GroupType', matlab.system.display.SectionType.group);% Return an array with the group-less section, the group with% two sections, and the group with no sections.groups = [alwaysSection,mainTab,initTab];endendend

The resulting dialog appears as follows when you add the object to Simulink®with theMATLAB Systemblock.