move - Move tree node - MATLAB (original) (raw)
Main Content
Syntax
Description
move([targetnode](#d126e1505114),[siblingnode](#d126e1505136))
moves the target node after the specified sibling node.
move([targetnode](#d126e1505114),[siblingnode](#d126e1505136),[location](#d126e1505158))
moves the target node after or before the specified sibling node. Specify location as 'after'
or 'before'
.
Examples
Create a tree containing two top-level nodes that each contain a child node.
fig = uifigure; tree = uitree(fig,'Position',[20 20 200 150]); node1 = uitreenode(tree,'Text','Runners'); node2 = uitreenode(tree,'Text','Cyclists'); runner = uitreenode(node1,'Text','Joe'); cyclist = uitreenode(node2,'Text','Rajeev');
Move Cyclists
beforeRunners
.
move(node2,node1,'before');
Move Cyclists
afterRunners
. Since the default value oflocation
is 'after'
, you can omit that argument.
Input Arguments
Target node, specified as a TreeNode
object.
Sibling node, specified as a TreeNode
object.
Target location, specified as 'after'
or'before'
.
Version History
Introduced in R2017b