How do I merge 3 figures from 3 different programs in a single figure ?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have 3 figures from 3 different codes and I want to merge all the 3 figures in a single figure.
I could merge 2 figures from 2 different codes using 'copyobj'.
But I'm unable to merge for 3 figures, I tried using the following code but I get an error.
f1 = figure;
my_work
f2 = figure;
shooting_method_scientific_rana_ode45
f3 = figure;
shooting_method_scientific_rana_ode45_2
copyobj(f3.Children.Children.Children, f2.Children, f1.Children)
I receive the following error
Error using copyobj
Too many input arguments.
Error in matching_result_3 (line 7)
copyobj(f3.Children.Children.Children, f2.Children, f1.Children
Is there a way to merge the 3 figures?
I also have attached the 3 m files here
댓글 수: 0
답변 (1개)
dpb
2018년 8월 6일
Syntax for copyobj is two arguments, the handle (vector) of things to retrieve and the handle of the target.
I've no idea whether the syntax of f3.Children.Children.Children makes any sense at all or not, or whether that's somehow related to your having three figures, but presuming there is something that deeply nested, the (approximate) syntax would be something like
hFNew=figure; % create the target
copyobj([f3.Children.Children.Children, f2.Children, f1.Children],hFnew)
Whether that would actually work will depend entirely on just what is in the three figures f1, f2, f3 and whether those above expressions actually return something or not.
댓글 수: 2
dpb
2018년 8월 7일
As Answer shows, put the "from" handles in a vector as first argument, "to" as the second...
참고 항목
카테고리
Help Center 및 File Exchange에서 Configure Simulation Conditions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!