Copy nodes and sub-nodes of uitree to another uitree
조회 수: 11 (최근 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!