フィルターのクリア

Copy nodes and sub-nodes of uitree to another uitree

10 ビュー (過去 30 日間)
Hossein Sadeghi
Hossein Sadeghi 2022 年 2 月 15 日
回答済み: James Sweetman 2023 年 1 月 2 日
Hi,
I have two trees in app-designer and created some nodes and subnodes in one of them as follows:
for i=1:length(data1)
nodes(i) = uitreenode(tree1,'Text',data1(i));
subnodes(i) = uitreenode(nodes(i),'Text',data2(i));
end
Now I want to copy these nodes and subnodes to the second tree. I used:
Copyobj(nodes, tree2);
This works fine when the tree has no subnodes, but throw error for my case with subnodes.
  2 件のコメント
Simon Chan
Simon Chan 2022 年 2 月 15 日
Did you try the following?
copyobj(nodes(1),tree2)
copyobj(nodes(2),tree2)
Hossein Sadeghi
Hossein Sadeghi 2022 年 2 月 15 日
Yes, same error!

サインインしてコメントする。

回答 (1 件)

James Sweetman
James Sweetman 2023 年 1 月 2 日
This seems to work!
arrayfun(@(x,y) copyobj(flipud(x.Children),y),tree1,tree2)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by