ヘルプ センターヘルプ センター
ツリー ノードを折りたたむ
collapse(parent)
collapse(parent,'all')
例
collapse(parent) は、親ツリーまたはツリー ノードのノードを折り畳みます。parent が Tree オブジェクトの場合、ツリーの最上位ノードは折りたたまれた状態で表示されます。最上位以外の子は折りたたまれません。親が TreeNode オブジェクトの場合、指定したノードは折りたたまれた状態で表示されますが、そのノードの中にある子は折りたたまれません。
parent
Tree
TreeNode
collapse(parent,'all') は、親ツリーまたはツリー ノードのすべての子を折り畳みます。
すべて折りたたむ
3 つのレベルのノードがあるツリーを作成し、すべてのノードを展開します。
fig = uifigure; tree = uitree(fig,'Position',[20 20 175 100]); % First level nodes category1 = uitreenode(tree,'Text','Runners'); category2 = uitreenode(tree,'Text','Cyclists'); % Second level nodes equip1 = uitreenode(category1,'Text','Equipment'); equip2 = uitreenode(category2,'Text','Equipment'); % Third level nodes shoes = uitreenode(equip1,'Text','Running Shoes'); bike = uitreenode(equip2,'Text','Bicycle'); helmet = uitreenode(equip2,'Text','Helmet'); % Expand all nodes expand(tree,'all');
最上位ノードを折りたたみます。
collapse(tree)
[Cyclists] ノードを展開します。
[Cyclists]
expand(category2)
[Equipment] 子ノードは既に展開されています。これは、前回実行した collapse コマンドでは [Cyclists] ノードのみが折りたたまれていたためです。すべての子ノードを折りたたむには、関数 collapse を呼び出すときに 'all' オプションを指定します。
[Equipment]
collapse
'all'
親ツリーまたはノード。Tree オブジェクトまたは TreeNode オブジェクトとして指定します。
R2017b で導入
expand | move | scroll | uitree | uitreenode
expand
move
scroll
uitree
uitreenode
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office