passing variable from one callback to another callback in gui

function first_Callback(hObject, eventdata, handles)
k=2;
function second_Callback(hObject, eventdata, handles)
g=k+1;
disp(g);
I want to use the k value in first function in second. How do I use it? Please help me...

回答 (2 件)

Rik
Rik 2019 年 5 月 12 日

0 投票

Store the value of k inside your guidata struct.

カテゴリ

ヘルプ センター および File ExchangeDisplay Image についてさらに検索

質問済み:

2019 年 5 月 12 日

回答済み:

2019 年 5 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by