필터 지우기
필터 지우기

how to extract large number of data points from 2D plot

조회 수: 15 (최근 30일)
Aiden James
Aiden James 2020년 9월 12일
댓글: Adam Danz 2020년 9월 16일
I want to extract large number of data points, like 30000 data ponits or more from 2d plot. Is it possible in matlab ?How to do it ?. These points will be used for other purpose but not for plotting. Thats why want large number of data points .

답변 (4개)

Adam Danz
Adam Danz 2020년 9월 12일
편집: Adam Danz 2020년 9월 14일
If you can reproduce the figure, just save the coordinates in addition to plotting them,
plot(x,y,'o')
save('coordinates.mat','x','y')
If you only have the .fig file and need to extract the coordinates, open the file so it's the current figure,
fig = gcf();
ax = gca(fig);
chil = ax.Children;
x = get(chil,'XData');
y = get(chil,'YData');
z = get(chil,'ZData');
x,y,z, will be vectors if only 1 set of data are plotted on the axes. If more than 1 object is plotted, x,y,z will be a n*1 cell array for n objects.

Ameer Hamza
Ameer Hamza 2020년 9월 12일
If instead of a fig file, you have an image, you can use this package to extract the data points: https://www.mathworks.com/matlabcentral/fileexchange/7173-grabit
  댓글 수: 5
Aiden James
Aiden James 2020년 9월 16일
Yes, I have tried it. But it is difficult to get large number of data points manually. Is there any command to get large number of data points, in which we can put no. of data points that points that we want.
Adam Danz
Adam Danz 2020년 9월 16일
I haven't used that function but if it doesn't allow the user to specify the sampling rate, you can certainly interpolate the values it extracts.

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


Aiden James
Aiden James 2020년 9월 16일

Aiden James
Aiden James 2020년 9월 16일

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by