finding data of a plot

3 Ansichten (letzte 30 Tage)
maryam
maryam am 6 Okt. 2014
Kommentiert: Azzi Abdelmalek am 6 Okt. 2014
hi. i have a plot like this and want to find these data value. i use "save work space as" and save data in a .mat file. but when i load mat file nothing appears. could you suggest me what to do?thanks in advance

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 6 Okt. 2014
Look at this example
% -----Example----------------------
x=repmat((1:10)',1,3);
y=rand(10,3);
for k=1:3
subplot(3,1,k);
plot(x(:,k),y(:,k));
end
%------The code-----------------------
h=findobj(gcf,'type','axes');
for k=1:3
f=get(h(k),'children');
xi{k}=get(f,'xdata');
yi{k}=get(f,'ydata');
end
outx=fliplr(cell2mat(xi')');
outy=fliplr(cell2mat(yi')');
  3 Kommentare
Adam
Adam am 6 Okt. 2014
You need to create the code yourself using the example under the "The code" part. The "Example" section just creates a figure to replicate the state you start from with a pre-existing figure.
Azzi Abdelmalek
Azzi Abdelmalek am 6 Okt. 2014
Myriam, If you have a figure, open it, then use the second part of my code, the first one is just an example
Open your figure then run this code
%------The code-----------------------
h=findobj(gcf,'type','axes');
for k=1:3
f=get(h(k),'children');
xi{k}=get(f,'xdata');
yi{k}=get(f,'ydata');
end
outx=fliplr(cell2mat(xi')');
outy=fliplr(cell2mat(yi')');

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Printing and Saving finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by