This problem has been discussed here before but all of the answers are not working for me.
The concept: I have a GUI with some edit boxes, programmed in Matlab 2012b. I want to immediately update a plot when the user enters a new numeric value in these edit boxes. The logical solution is programming a Keypressfcn callback for the edit box, which reads out the 'String' value of the box and updates the plot with this newly entered value. The problem with the String value of edit boxes is that it only updates after pressing Enter (which is not really logical for the user) or losing focus of the edit box.
I tried different proposed solutions: # 1. Putting a pause in the keypressfcn callback. Does not solve the problem. # 2. Let Java simulate an Enter key press in the keypressfcn callback. Problem is that this Enter is registered as a key press, which fires another key prees callback -> infinite loop. # 3. Program the keypressfcn callback to lose and quickly regain focus of the edit box. This works, but the problem is that during the regaining of the focus, the contents of the edit box are selected, so if you want to enter a number higher than 10 you have to manually deselect the contents by clicking with the mouse. Extremely cumbersome to use.
That's all I could find, any other options?