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

33 Ansichten (letzte 30 Tage)
Baba
Baba am 16 Feb. 2012
Bearbeitet: John Kelly am 27 Mai 2014
how do I extract the x y data from a matlab figure? Thank you.

Antworten (3)

Honglei Chen
Honglei Chen am 16 Feb. 2012
Bearbeitet: John Kelly am 27 Mai 2014
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 Kommentar
Baba
Baba am 16 Feb. 2012
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?

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 16 Feb. 2012
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 am 16 Feb. 2012

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by