finding data of a plot

조회 수: 4 (최근 30일)
maryam
maryam 2014년 10월 6일
댓글: Azzi Abdelmalek 2014년 10월 6일
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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 10월 6일
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
Adam
Adam 2014년 10월 6일
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 2014년 10월 6일
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')');

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by