exportAsStruct
説明
例
状態遷移表を使用したバンバン制御器のモデル化の状態遷移表の内容を構造体の配列としてエクスポートします。この状態遷移表には、2 つの最上位ステートと 3 つのサブステートが含まれています。
状態遷移表の Stateflow.StateTransitionTableChart にアクセスします。
table = find(sfroot,"-isa","Stateflow.StateTransitionTableChart");
状態遷移表の内容を、構造体の配列としてエクスポートします。
structure = exportAsStruct(table)
structure =
1×5 struct array with fields:
rowText
depth
rowType
isDefaultTransitionOwner
isWhenState
hasHistory
isExpanded
outlinedTransitionIdxs
sfObjectInfo
aslInfo
decompositionInfo最上位ステートの内容を表示します。
structure(1)
ans =
struct with fields:
rowText: {'Normal' {3×1 cell} {3×1 cell}}
depth: 1
rowType: 0
isDefaultTransitionOwner: 1
isWhenState: 0
hasHistory: 0
isExpanded: 1
outlinedTransitionIdxs: [0 0 0]
sfObjectInfo: [1×3 struct]
aslInfo: [1×1 struct]
decompositionInfo: [1×1 struct]子ステートの内容を表示します。
structure(4)
ans =
struct with fields:
rowText: {'On↵entry:↵boiler_cmd = 1;' {3×1 cell} {3×1 cell}}
depth: 2
rowType: 0
isDefaultTransitionOwner: 0
isWhenState: 0
hasHistory: 0
isExpanded: 0
outlinedTransitionIdxs: [0 0 0]
sfObjectInfo: [1×3 struct]
aslInfo: [1×1 struct]
decompositionInfo: [1×1 struct]状態遷移表を使用したバンバン制御器のモデル化の状態遷移表の内容を構造体の階層としてエクスポートします。この状態遷移表には、2 つの最上位ステートと 3 つのサブステートが含まれています。
状態遷移表の Stateflow.StateTransitionTableChart にアクセスします。
table = find(sfroot,"-isa","Stateflow.StateTransitionTableChart");
状態遷移表の内容を構造体の階層としてエクスポートします。
structure = exportAsStruct(table,true)
structure =
struct with fields:
tableData: [1×2 struct]
columnWidths: [209 175 174]
tableId: 172最上位ステートの内容を表示します。
structure.tableData(1)
ans =
struct with fields:
stateLabel: 'Normal'
transitions: [1×2 struct]
rowHeights: {[30] [30] [30]}
hasHistory: 0
isDefaultTransitionOwner: 1
isWhenState: 0
isExpanded: 1
hasRequirements: 0
hasBreakpoints: 0
hasEnabledBreakpoints: 0
children: [1×3 struct]
rowType: 0
possibleDestinations: {'' 'Alarm' '$NEXT' '$SELF' '% IGNORE %'}
decompositionInfo: [1×1 struct]子ステートの内容を表示します。
structure.tableData(1).children(3)
ans =
struct with fields:
stateLabel: 'On↵entry:↵boiler_cmd = 1;'
transitions: [1×2 struct]
rowHeights: {[53] [30] [30]}
hasHistory: 0
isDefaultTransitionOwner: 0
isWhenState: 0
isExpanded: 0
hasRequirements: 0
hasBreakpoints: 0
hasEnabledBreakpoints: 0
children: []
rowType: 0
possibleDestinations: {'' '$PREV' 'Off' 'Warmup' '$SELF' '% IGNORE %'}
decompositionInfo: [1×1 struct]入力引数
状態遷移表。Stateflow.StateTransitionTableChart オブジェクトとして指定します。
構造体の階層を作成するかどうか。数値あるいは logical の 1 (true) または 0 (false) として指定します。この引数により、出力引数 structure の形式が決まります。
出力引数
状態遷移表の内容。構造体配列として返されます。structure の形式は、入力引数 hierarchical に依存します。
hierarchicalがfalseの場合、structureは状態遷移表の各ステートの構造体を含む配列です。これらの構造体のそれぞれにおいて、フィールドdepthは階層内の各ステートのレベルを示します。構造体の配列の作成を参照してください。hierarchicalがtrueの場合、structureはフィールドtableData、columnWidths、およびtableIdをもつ構造体です。tableDataは、状態遷移表の各最上位ステートの構造体を含む配列です。これらの構造体のそれぞれにおいて、フィールドchildrenは各サブステートの構造体を含む配列です。状態遷移表内のステートの以降の階層レベルにおいても同様となります。構造体の階層の作成を参照してください。
バージョン履歴
R2022b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)