Handles variable in GUIDE is not updating
Show older comments
Hi, everybody.
I already looked for an answer throughout content in MatLab website, but I didn't found a solution, even that there are some questions with this subject like in: http://www.mathworks.com/matlabcentral/newsreader/view_thread/259633 It didn't is the solution (and I read all the guidata's doc, like suggested). My problem is that I recorded an information in the "handles" structure within one GUIDE's function and I can't retrieve this information in another function.
And as soon as I execute the GUI I get this error message: http://s11.postimage.org/5trvp5c83/Captura_de_tela_2012_08_06_a_s_12_25_55.png
I tried to change the UIWAIT variable (<http://paste.ideaslabs.com/show/6QQr4NqA4A>), to wait the user close the window, after click in button, and then try to take the handle variable. But it doesn't work too, like you can see here: http://s7.postimage.org/5s6lk8tyj/Captura_de_tela_2012_08_06_a_s_12_31_31.png
Please, I need to finish a work and I can't because of this issue. Any help will be welcome. Thank for your attention.
1 Comment
Seyhan Emre Gorucu
on 6 Aug 2012
I had the same problem. finally, I put all the functions inside the main function. Now it works well.
Answers (1)
Sean de Wolski
on 6 Aug 2012
Edited: Sean de Wolski
on 6 Aug 2012
It is not updating because you are calling guidata with hObject in the pushbutton's callback. hObject in the pushbutton's callback will be the pushbutton, not the figure.
Thus you would want:
guidata(handles.figure1,handles) %or handles.(whatever the tag for the figure is)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!