Effacer les filtres
Effacer les filtres

How do I merge 3 figures from 3 different programs in a single figure ?

2 vues (au cours des 30 derniers jours)
naygarp
naygarp le 6 Août 2018
Commenté : dpb le 7 Août 2018
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

Réponses (1)

dpb
dpb le 6 Août 2018
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 commentaires
naygarp
naygarp le 7 Août 2018
I might have got the syntax of 'copyobj' wrong with
copyobj(f3.Children.Children.Children, f2.Children, f1.Children)
So, is there any other way to merge the three figures in a single figure by 'copyobj' or any other function.
dpb
dpb le 7 Août 2018
As Answer shows, put the "from" handles in a vector as first argument, "to" as the second...

Connectez-vous pour commenter.

Catégories

En savoir plus sur Specifying Target for Graphics Output dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by