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.

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 11 Mai 2013

2 votes

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 commentaires

Alvi Syahrin
Alvi Syahrin le 12 Mai 2013
Thank you.
Amirhosein Ghenaati
Amirhosein Ghenaati le 20 Nov 2014
yes i will do your method

Connectez-vous pour commenter.

Plus de réponses (1)

Catégories

En savoir plus sur Programming dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by