MATLAB 도움말 센터
객체의 자식 식별
objArray = getChildren(parent)
objArray = getChildren(parent)는 지정된 부모가 있는 객체의 배열을 반환합니다.
objArray
parent
예제
모두 축소
다음 제품이 필요합니다.
이 차트에는 A 상태와 디폴트 천이라는 두 개의 자식이 있습니다. 상태 A에는 상태 A1, 상태 A2, 천이 2개로 구성된 네 개의 자식이 있습니다.
A
A1
A2
모델을 열고 차트의 Stateflow.Chart 객체에 액세스합니다.
Stateflow.Chart
open_system("sfHierarchyAPIExample") ch = find(sfroot,"-isa","Stateflow.Chart");
차트의 자식을 식별합니다. 자식의 객체 유형을 표시합니다.
children = getChildren(ch); classes = arrayfun(@class,children,UniformOutput=false)
classes = 2×1 cell {'Stateflow.State' } {'Stateflow.Transition'}
children의 한 요소는 상태입니다. 상태의 이름을 표시합니다.
children
idx = (classes=="Stateflow.State"); state = children(idx); state.Name
ans = 'A'
상태 A의 자식을 식별합니다. 자식의 객체 유형을 표시합니다.
grandchildren = getChildren(state); classes = arrayfun(@class,grandchildren,UniformOutput=false)
classes = 4×1 cell {'Stateflow.State' } {'Stateflow.State' } {'Stateflow.Transition'} {'Stateflow.Transition'}
grandchildren의 두 요소는 상태입니다. 상태의 이름을 표시합니다.
grandchildren
idx = (classes=="Stateflow.State"); grandchildren(idx).Name
ans = 'A1'
ans = 'A2'
Stateflow.State
Stateflow.Box
Stateflow.Function
부모 객체로, 다음 유형 중 하나의 Stateflow® API 객체로 지정됩니다.
Stateflow.EMChart
Stateflow.EMFunction
Stateflow.SimulinkBasedState
Stateflow.SLFunction
Stateflow.StateTransitionTableChart
Stateflow.TruthTable
Stateflow.TruthTableChart
R2006a 이전에 개발됨
find
getParent
arrayfun
class
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의