このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
getChildren
オブジェクトの子の特定
説明
例
チャートの子の特定
このチャートに対応する Stateflow.Chart
オブジェクトが ch
であるとします。このチャートには、ステート A
とデフォルト遷移の 2 つが子として含まれています。ステート A
には、ステート A1
、ステート A2
、および 2 つの遷移の 4 つが子として含まれています。
チャート ch
の子を特定します。子のオブジェクト タイプを表示します。
children = getChildren(ch); arrayfun(@class,children,UniformOutput=false)
ans = 2×1 cell array {'Stateflow.State' } {'Stateflow.Transition'}
children
の最初の要素はステートです。ステートの名前を表示します。
state = children(1); state.Name
ans = 'A'
ステート A
の子を特定します。子のオブジェクト タイプを表示します。
grandchildren = getChildren(state); arrayfun(@class,grandchildren,UniformOutput=false)
ans = 4×1 cell array {'Stateflow.State' } {'Stateflow.State' } {'Stateflow.Transition'} {'Stateflow.Transition'}
grandchildren
の最初の 2 つの要素はステートです。ステートの名前を表示します。
grandchildren(1).Name
ans = 'A1'
grandchildren(2).Name
ans = 'A2'
入力引数
parent
— 親オブジェクト
Stateflow.Chart
オブジェクト | Stateflow.State
オブジェクト | Stateflow.Box
オブジェクト | Stateflow.Function
オブジェクト | ...
バージョン履歴
R2006a より前に導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)