"mark b." <john.doe.nospam@mathworks.com> wrote in message
<g3dki1$of8$1@fred.mathworks.com>...
> hi,
> i've got such a question:
> this line of a code gets me the value that is returnet by
> function 'update':
>
> set(handles.figure1,'windowbuttondownfcn','p=update')
>
> but now i want to put whis value (p) into some variable, so
> that i can use it later.but i do not know how.
> can anyone suggest me anything?
>
> kind regards
get(handles.figure1,'WindowButtonDownFcn') may work,
assuming i've understood your query properly.
"mark b." <john.doe.nospam@mathworks.com> wrote in message
news:g3dki1$of8$1@fred.mathworks.com...
> hi,
> i've got such a question:
> this line of a code gets me the value that is returnet by
> function 'update':
>
> set(handles.figure1,'windowbuttondownfcn','p=update')
>
> but now i want to put whis value (p) into some variable, so
> that i can use it later.but i do not know how.
> can anyone suggest me anything?
When you write a callback like this, the string you SET as your
WindowButtonDownFcn is executed as though you typed it at the command line,
so the variable p is created in the base workspace.
Instead, I'd recommend either modifying the update function so that it
stores the value it would have output in the figure's UserData property or
in the handles structure (using GUIDATA and/or GUIHANDLES) or explicitly
setting the output into UserData in the callback.
"mark b." <john.doe.nospam@mathworks.com> wrote in message
<g3dnup$43c$1@fred.mathworks.com>...
> set(handles.figure1,'windowbuttondownfcn','set
> (handles.figure1, ''UserData'', update)')
>
> it returns me
> ??? Undefined variable "handles" or class "handles.figure1".
>
>
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.