Robust Control Toolbox    
tree, istree

Pack all information and data from several matrices, vectors and/or strings into a single `tree' variable. tree implements the Robust Control Toolbox hierarchical tree data structure.

Syntax

Description
tree creates a data structure T, called a tree containing several variables and their names. This single variable contains all the data and dimension information from its branches b1, b2, b3,, bn along with a numerical index and a string name for each branch.

The input argument nm is a string containing a list of names (separated by commas) to be assigned to the respective branches b1,b2,...,bn

The names may be any valid variable names and must be separated by commas. If no names are to be assigned, set "nm = ";.

The input arguments b1,b2,,bn (called the root branches of the tree) may be matrices, vectors, strings, or even trees themselves, thus enabling the creation of a hierarchical tree data structure within the MATLAB framework.

istree checks whether a variable T is a tree or not.

returns I=1 (true) if "T" is a tree variable created by the function tree; otherwise it returns I=0 (false). When the second input argument PATH is present, the function istree checks the existence of the branch specified by PATH. For example,

returns "I = 1", if both "T" is a tree variable and "PATH" is a valid path to a branch in the tree T. Otherwise, it returns "I = 0". If the optional output argument "B" is present, then B returns the value of the branch specified by PATH, provided T is a tree and PATH is a valid path in T.

Related functions include the following:

Examples
A hierarchical tree structure shown inFigure 1-17 can be built as follows

Figure 1-17: Example of Tree Structure.

To extract a variable from a tree, simply use the branch function:

Paths in a tree are also determined by the numerical indices of the branches which lead to the branch of interest. For example, the last line above is equivalent to

See branch for further details.

See Also
branch, mksys, graft, istree, issystem, vrsys



tfm2ss youla