uitree
Create tree or check box tree component.
📝Syntax
h = uitree()
h = uitree(parent)
h = uitree(..., propertyName, propertyValue)
📥Input Arguments
Parameter Description
parent parent object.
propertyName, propertyValue name-value pairs.
📤Output Arguments
Parameter Description
h UI object.
📄Description

t = uitree creates a tree; uitree(parent, 'checkbox') creates a check box tree. Children are uitreenode objects. Properties: SelectedNodes, Multiselect (standard tree), CheckedNodes/CheckedNodesChangedFcn (checkbox tree), Editable, SelectionChangedFcn, NodeExpandedFcn, NodeCollapsedFcn. Use expand(t) / collapse(t).

💡Examples
Captured UI component for the help image.
f = uifigure('Visible', 'off', 'Name', 'Tree', 'Position', [100 100 420 260]);
tr = uitree(f, 'Position', [70 40 210 180]);
n1 = uitreenode(tr, 'Text', 'Fruits');
uitreenode(n1, 'Text', 'Apple');
uitreenode(n1, 'Text', 'Banana');
expand(tr);
drawnow();
Example illustration
uitree
f = uifigure();
t = uitree(f);
n1 = uitreenode(t, 'Text', 'Fruits');
n2 = uitreenode(n1, 'Text', 'Apple');
expand(t);
🔗See Also
uifigure
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub