How can I plot multiple figures in one from multiple saved .fig files that have 2 figures but I only want 1 of them?

2 Ansichten (letzte 30 Tage)
I have run multiple simulations of a system and in each run I changed one parameter. I saved the .fig files of a scope I am interested in but the scope plots 2 figures separated by the layout function (so there is one on top and one on the bottom part when you click/view the scope). How can I plot only the top figure (1st input in the scope) from the various .fig files that I saved? I want to highlight the difference when I change a specific parameter (increase and decrease) and repeat for each parameter that I changed.
Thank you a lot in advance!

Akzeptierte Antwort

Star Strider
Star Strider am 30 Jan. 2025
It would help to have at least one of the .fig files to work with.
In general, use the openfig function to open each file. That creates a handle to it, and it should be relatively straightforward to get the line objects from it, using the findobj function. (I am not familiar with the various plotting functions the scope uses, so I hesitate to go further without one to experiment with.)
  3 Kommentare
Charalampos
Charalampos am 31 Jan. 2025
Thank you both for your answers and you were right!
This morning I found this similar question so I managed to do what I wanted. Here is the link and the code for reference:
fig1 = openfig("fig1.fig");
fig2 = openfig("fig2.fig");
fig3 = openfig("fig3.fig");
L = findobj(fig1,'type','line');
copyobj(L,findobj(fig2,'type','axes'));
L2 = findobj(fig3,'type','line');
copyobj(L2,findobj(fig2,'type','axes'));

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by