Why guidata() doesn't work on an user function?
Ältere Kommentare anzeigen
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 Kommentar
Mike D.
am 19 Sep. 2016
Use appdata instead.
Akzeptierte Antwort
Weitere Antworten (1)
Dani Tormo
am 5 Dez. 2012
0 Stimmen
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!