Main Content

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

getParent

객체의 부모 식별

설명

예제

parent = getParent(object)는 Stateflow® 차트, State Transition Table 블록, Truth Table 블록 또는 MATLAB® Function 블록에 있는 객체의 부모를 반환합니다.

예제

모두 축소

이 차트에서 상태 A1의 부모는 상태 A입니다. 상태 A의 부모는 차트입니다.

Stateflow chart with a hierarchy of states. The outer state is called A. It contains two inner states called A1 and A2.

모델을 열고 차트의 Stateflow.Chart 객체에 액세스합니다.

open_system("sfHierarchyAPIExample")
ch = find(sfroot,"-isa","Stateflow.Chart");

A1이라는 이름의 Stateflow.State 객체를 찾습니다.

sA1 = find(sfroot,"-isa","Stateflow.State",Name="A1");

상태 A1의 부모를 식별합니다. 부모의 이름을 표시합니다.

parent = getParent(sA1);
parent.Name
ans = 
'A'

상태 A의 부모를 식별합니다. 부모의 이름을 표시합니다.

grandparent = getParent(parent);
grandparent.Name
ans = 
'Chart'

입력 인수

모두 축소

버전 내역

R2006a 이전에 개발됨