Main Content

matlab.system.display.SectionGroup クラス

パッケージ:matlab.system.display
スーパークラス:

System object のセクション グループ

構文

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

説明

matlab.system.display.SectionGroup(N1,V1,...Nn,Vn)は、matlab.system.display.Sectionによって作成された System object™ プロパティを表示するグループと表示セクションを作成します。プロパティの名前と値のペア (N,V) を使って、このようなセクションまたはプロパティを定義します。セクション グループには、プロパティとセクションの両方を含めることができます。getPropertyGroupsImplメソッドを使ってセクション グループを定義するには、matlab.system.display.SectionGroupを使用します。セクション グループは、MATLAB Systemブロック内の個別のタブとして表示されます。使用可能なセクション プロパティは次のとおりです。

  • Title— グループ タイトル。既定値は空の文字ベクトルです。

  • TitleSource— グループ タイトルのソース。有効な値は'Property'および'Auto'です。既定値は'Property'です。この値は、Titleプロパティからの文字ベクトルを使用します。Objという名前を指定した場合、既定値はAutoで、Objの名前を使用します。MATLAB®コマンド ラインの System object プロパティ表示では、TitleSource'Auto'に設定することで、プロパティの最初のグループの既定の "メイン" タイトルを省略できます。

  • Description— 任意のプロパティまたはパネルの上に表示されるグループまたはタブの説明。既定値は空の文字ベクトルです。

  • PropertyList— プロパティ名の cell 配列としてのグループまたはタブ プロパティ リスト。既定値は空の配列です。Obj名を指定した場合、既定値はすべての有効な表示プロパティです。

  • Sections— セクション オブジェクトの配列としてのグループ セクション。Objという名前を指定した場合、既定値はObjの既定セクションです。

  • Type— コンテナーのタイプ。たとえば、タブ、グループ、パネル、および折りたたみ可能なパネル。

  • Row— コンテナーを配置する必要がある行を指定します (現在/新規)。行は enum クラス matlab.system.display.internal.Row を使用して指定できます。

  • AlignPrompts— コンテナー内のプロンプトの整列を制御するブール値を指定します。

matlab.system.display.SectionGroup(Obj,...)は、指定された System object (Obj) のセクション グループを作成し、次のプロパティ値を設定します。

  • TitleSource'Auto'に設定します。

  • SectionsObjmatlab.system.display.Sectionオブジェクトに設定します。

このメソッド内からmfilename(类)を使用して System object の名前を取得することができます。任意の名前と値のペアを設定した場合、そのプロパティ値は既定の設定をオーバーライドします。

すべて折りたたむ

クラス定義ファイルで、それぞれが特定のプロパティを含む 2 つのタブを定義します。この例では、matlab.system.display.SectiongetPropertyGroupsImplおよびmatlab.system.display.SectionGroupメソッドを使用します。

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

MATLAB Systemブロックをもつ Simulink®にオブジェクトを追加すると、生成されるダイアログは次のようになります。