Date: Dec 30, 2012 12:21 AM
Author: Nima Nikvand
Subject: Event Object for Datacursormode

Hello everyone,

I am trying to capture data information on the plot using datacursormode, my general format is as follows:

fig = figure();
dcmObj=datacursormode(fig);
t=0:0.01:10;
x = sin(t);
plot(t,x);
set(dcmObj,'Enable','on',...
'SnapToDataVertex','on', ...
'DisplayStyle','datatip',...
'UpdateFcn',@datatextbox);

where datatextbox is my update function and its general format is:

function [txt,pos] = datatextbox(~,event_obj)

and this works very well. However, I'd like to be able to get the output of my datatextbox function and I was wondering if I can some how call the function directly by passing the event_obj to it. I'd greatly appreciate your suggestions, or any other solutions to get the output arguments.