Copy nodes and sub-nodes of uitree to another uitree
10 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
James Sweetman
2023-1-2
This seems to work!
arrayfun(@(x,y) copyobj(flipud(x.Children),y),tree1,tree2)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!