Main Content

up

(Not recommended) Identify parent of object

Using up is not recommended. Use getParent instead.

Description

parent = up(object) returns the parent of an object in a Stateflow® chart, State Transition Table, Truth Table, or MATLAB® Function block.

example

Examples

collapse all

Suppose that ch is the Stateflow.Chart object that corresponds to this chart. In this chart, the parent of state A1 is state A. The parent of state A is the chart.

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

Find the Stateflow.State object named A1.

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

Identify the parent of state A1. Display the name of the parent.

parent = up(sA1);
parent.Name
ans =

    'A'

Identify the parent of state A. Display the name of the parent.

grandparent = up(parent);
grandparent.Name
ans =

    'Chart'

Input Arguments

collapse all

Version History

Introduced before R2006a