export x and y data from a matlab plot into a matrix

조회 수: 33 (최근 30일)
Baba
Baba 2012년 2월 16일
편집: John Kelly 2014년 5월 27일
how do I extract the x y data from a matlab figure? Thank you.

답변 (3개)

Honglei Chen
Honglei Chen 2012년 2월 16일
편집: John Kelly 2014년 5월 27일
You need to access XData and YData property, for example:
h = plot(1:10);
get(h,'XData')
get(h,'YData')
Here is a handy tool to find out the handle graphics properties
  댓글 수: 1
Baba
Baba 2012년 2월 16일
What if I don't have access to h? and just have a plot in front of me that pops up due to some code running?

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


Image Analyst
Image Analyst 2012년 2월 16일
If it just recently popped up, and you can run some code to get to it before focus switches to some other figure, then you can use gca or gcf for the handle.

Patrick Kalita
Patrick Kalita 2012년 2월 16일

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by