how to use a variable returned from one callback function in an other callback funtion in GUI??

1 次查看(过去 30 天)
I have two functions called sum1_Callback and disp_Callback
function c=sum1_Callback(hObject, eventdata, handles) c= 2*2;
function disp_Callback(hObject, eventdata, handles,c) disp(c)
In sum_Callback, I have a variable c which I want to use in disp_Callback, but I get an error telling the variable is undefined.
What should be done??
Thanks in advance for the help.

回答(1 个)

Walter Roberson
Walter Roberson 2013-9-13
There are no callbacks that take eventdata as the second parameter and return values. The only callbacks that return values are the ones that are acting as filters, such as a constraint function programmed to ensure that a rectangle selection retains a particular proportion.

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by