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