"Matt J" wrote in message <email@example.com>... > "Nima Nikvand" <firstname.lastname@example.org> wrote in message <email@example.com>... > > > > 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. > ============= > > If you make datatextbox a nested function, every variable in its workspace will also be available in the workspace in which it is nested.
You could also call setappdata from within datatextbox and store the txt,pos output data to the parent figure. Pass the figure handle to datatextbox using this syntax