multiple datatip value extraction

61 views (last 30 days)
kumaresan
kumaresan on 17 May 2012
i have plotted my graph and have marked certain peaks in the graph with datatips. now i would like to extract all the marked values to either work space or anywer else so that i can plot those data again. i'm using R2009b

Accepted Answer

Richard
Richard on 21 May 2012
Hi Kumaresan, You can get the values of datatip positions using the datacursormode and getCursorInfo functions:
d = datacursormode(fig);
vals = getCursorInfo(d);
where fig is the handle to your figure and vals is a structure containing positions and data indices.
  2 Comments
kumaresan
kumaresan on 24 May 2012
this is the comand i use to plot
h=semilogx(t1fft1hz,t1fft1g),
then i placed 5 datatips on my graph.
then i entered,
d = datacursormode(h);
vals = getCursorInfo(d);
mathlab showed,
??? Error using ==> datacursormode at 138
Invalid figure handle
wher did i went wrong?
Walter Roberson
Walter Roberson on 24 May 2012
datacursormode() must be applied to a figure as a whole, not to a plot within a figure.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!