Why guidata() doesn't work on an user function?
Afficher commentaires plus anciens
Hi,
I have a variable stored in handles.switches.
I get into a callback function. I change this variable and at the end I execute guidata(hObject, handles) and this variable is updated. Fine.
The problem is if I update this variable in a user function inside this callback function. The handles.switches then is not updated although I execute at the end guidata(hObject, handles).
What can I do to update this variable inside other function?
I tried using set but it gives me an error. I am not using well this command.
>> set(handles.switches, 'UserData', work_comb);
Error using handle.handle/set
Invalid or deleted object.
But if I make a breakpoint at this line and write down handles.switches, the variable exists! I don't know what's going on...
Thanks!
1 commentaire
Mike D.
le 19 Sep 2016
Use appdata instead.
Réponse acceptée
Plus de réponses (1)
Dani Tormo
le 5 Déc 2012
0 votes
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!