Azzera filtri
Azzera filtri

finding data of a plot

3 visualizzazioni (ultimi 30 giorni)
maryam
maryam il 6 Ott 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

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 6 Ott 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 Commenti
Adam
Adam il 6 Ott 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 il 6 Ott 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')');

Accedi per commentare.

Categorie

Scopri di più su Graphics Object Identification in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by