Problem with waitforbuttonpress in datacursormode

1 view (last 30 days)
I have seen several similar posts, but no solution to this problem!
I have a 3D plot in a GUI and would like to select a point using datacursormode.
What I really want to do is this:
dcmObj = datacursormode(handles.figure1); set(dcm_obj,'DisplayStyle','datatip', 'SnapToDataVertex','on','Enable','on') waitforbuttonpress; point = getCursorInfo(dcmObj);
Waitforbuttonpress pauses appropriately, but "point" returns as an empty array.
Similar postings on the forum have suggested using "pause" in place of waitforbuttonpress, which works, but requires the user to press a key in order to resume - this is not an appropriate workaround for my application.
Alternative suggestions have been to use ginput instead of datacursor, but I really need the 'SnapToDataVertex' functionality.
Interestingly, many of the examples in the matlab documentation do not have a "pause" or a "waitforbuttonpress"; however, this does not work, as the function executes and returns without any cursor data.
Still others have said that the "waitforbuttonpress" method works for them (I believe only in older versions). I have R2010b.
Any suggestions?

Answers (0)

Categories

Find more on Downloads in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!