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

12 次查看(过去 30 天)
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 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by