Filter löschen
Filter löschen

save the information of the point by clicking on the graph

12 Ansichten (letzte 30 Tage)
khatereh
khatereh am 7 Nov. 2012
Hi,
I have a series of plots that will show up one after another, I want to activate the action that for each plot the user should pick two points in the plot ( start and end) and the information of those two points will be saved for all those graphs.Can anybody know how to tackle this problem?
thanks

Antworten (1)

Evan
Evan am 7 Nov. 2012
Bearbeitet: Evan am 7 Nov. 2012
You can get the indices of your selection by calling datacursormode and setting a custom update function. Example:
function cursortest
fig = figure;
imagesc
h = datacursormode(fig);
set(h,'UpdateFcn',@myupdatefcn)
datacursormode on
end
function txt = myupdatefcn(obj,event_obj)
% Get selection position
txt = get(event_obj,'Position')
end
That would give you the information you need to obtain and save the selected values from your plotted arrays.

Kategorien

Mehr zu Line Plots 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