Set the Variable 'Global' in GUI?
1 回表示 (過去 30 日間)
古いコメントを表示
Alvi Syahrin
2013 年 5 月 11 日
コメント済み: Amirhosein Ghenaati
2014 年 11 月 20 日
I'm working with MATLAB GUI.
When I'm trying to access the variable which was defined with the push button, it is not defined in the pop up menu. The variables; it should be set 'global', so it is defined in the whole program. And I can use it in any callback.
Do you guys have any idea of how to make the variables 'global'?
Your help will be much appreciated.
Thank you.
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 5 月 11 日
If you want to use it in any callback use guidata
handles.yourvar=yourvar
guidata(hObject,handles)
To use the variable yourvar
yourvar=handles.yourvar
2 件のコメント
その他の回答 (1 件)
Image Analyst
2013 年 5 月 12 日
Just say
global yourVariable;
in any function that needs to access the variable.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!