How to plot multiple figures (.fig) into one figure?

5 Ansichten (letzte 30 Tage)
Riadh Dhaoui
Riadh Dhaoui am 16 Jun. 2020
Kommentiert: Riadh Dhaoui am 16 Jun. 2020
Dear member of the community,
I am new to MATLAB and need your assistant.
I have several .fig files. Is it possible to somehow take the actions of the individual characters and then make them into a plot?
I would like to point out the differences between these "curve fits". For example: path_ground.fig path_gmapping.fig
I have tried Servel attempts (like https://de.mathworks.com/matlabcentral/answers/333909-how-to-plot-multiple-figures-fig-into-one-figure), but without success.
Your help will be greatly appreciated.
I thank you in advance

Antworten (1)

drummer
drummer am 16 Jun. 2020
what about this one?
  1 Kommentar
Riadh Dhaoui
Riadh Dhaoui am 16 Jun. 2020
Thank you Not bad, but here the right solution
clear;
close all;
clc;
f = openfig('test1.fig');
H = findobj(gca,'Type','line');
x_data = cell2mat(get(H,'xdata'));
y_data = cell2mat(get(H,'ydata'));
%close(f)
g = openfig('test2.fig');
G = findobj(gca,'Type','line');
x1_data = cell2mat(get(G,'xdata'));
y1_data = cell2mat(get(G,'ydata'));
%close(g)
t = openfig('gmapping.fig');
T = findobj(gca,'Type','line');
x2_data = cell2mat(get(T,'xdata'));
y2_data = cell2mat(get(T,'ydata'));
figure
scatter(x_data,y_data,'r','.');
hold on
scatter(x1_data,y1_data,'g','.');
hold on
scatter(x2_data,y2_data,'k','.');
xlabel('x');
ylabel('y');

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by