finding data of a plot

3 visualizaciones (últimos 30 días)
maryam
maryam el 6 de Oct. de 2014
Comentada: Azzi Abdelmalek el 6 de Oct. de 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

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 6 de Oct. de 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 comentarios
Adam
Adam el 6 de Oct. de 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 el 6 de Oct. de 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')');

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by