Main Content

wtreemgr

    Description

    wtreemgr(option,T,varargin) returns information on the tree T depending on the value of option. Use varargin to specify additional input arguments associated with the specified option.

    example

    Examples

    collapse all

    Create a binary tree (a tree of order 2) of depth 3. Plot the tree.

    t = ntree(2,3);
    fig = plot(t);

    Figure contains an axes object and an object of type uimenu. The axes object with title Tree Decomposition contains 29 objects of type line, text.

    Programmatically, in Node Label, change the selected item from Depth_Position to Index.

    plot(t,"setNodeLabel",fig,"Index")

    Figure contains an axes object and an object of type uimenu. The axes object with title Tree Decomposition contains 29 objects of type line, text.

    Use wtreemgr to find all the descendents of the node at index 2.

    wtreemgr("nodedesc",t,2)
    ans = 7×1
    
         2
         5
         6
        11
        12
        13
        14
    
    

    Input Arguments

    collapse all

    Tree parameter, specified as one of these:

    Tree ParameterDescription
    "allnodes"Tree nodes (allnodes)
    "isnode"True for existing node (isnode)
    "istnode"True for terminal nodes (istnode)
    "nodeasc"Node ascendants (nodeasc)
    "nodedesc"Node descendants (nodedesc)
    "nodepar"Node parent (nodepar)
    "ntnode"Number of terminal nodes (ntnode)
    "tnodes"Terminal nodes (tnodes)
    "leaves"Terminal nodes (leaves)
    "noleaves"Not terminal nodes (noleaves)
    "order"Tree order (treeord)
    "depth"Tree depth (treedpth)

    Tree, specified as a ntree, dtree, or wptree object.

    Version History

    Introduced before R2006a