Extract coordinate data from plotm figure?

조회 수: 22 (최근 30일)
John Sena Akoto
John Sena Akoto 2021년 8월 29일
댓글: Walter Roberson 2021년 8월 29일
Hello, I made a map from latitude (X), longitude (Y), and elevation (Z) data. Unfortunately, I can't find the original data that I used. However I do have the matlab figure. How can I extract the X, Y, and Z data from the Matlab fig file?
Attached is the matlab fig file I would like to extract the data from.

채택된 답변

DGM
DGM 2021년 8월 29일
Something like this:
F = openfig('sample_map.fig');
h = findobj(F,'type','surface');
x=get(h,'xdata');
y=get(h,'ydata');
z=get(h,'zdata');
That's assuming you're after the surface plot data. If there are other objects in the axes which have data you need, you'll have to find them too.
  댓글 수: 2
John Sena Akoto
John Sena Akoto 2021년 8월 29일
Thanks very much for the response. But I hope to get back the original data I used to generate the plot and not the surface plot data. For example the 'z' variable is filled with all zeros. I hope to get a 'z' variable filled with the attribute data I used originally to generate the plot.
Walter Roberson
Walter Roberson 2021년 8월 29일
F = openfig('sample_map.fig');
h = findobj(F,'type','surface');
x=get(h,'xdata');
y=get(h,'ydata');
z=get(h,'cdata');

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by