How to get data from edit text box in GUI with a push button
2 views (last 30 days)
Show older comments
Hi,
I am building a GUI with an edit text box and a puch button, and I want to save the data (which is written by the user) from the edit box to a variable when the button is pushed. So I was using this code, but I got the error of:
Attempt to reference field of non-structure array.
Error in untitled>button_send_Callback (line 105) data = get(handles.datatosend, 'String');
The code: global data; data = get(handles.datatosend, 'String');
I have no idea what can be the problem. Thank you for helping.
4 Comments
Answers (1)
Geoff Hayes
on 4 Apr 2017
GUIDE-created GUIs can be launched from the GUI editor, the m-file editor, or from the command line by invoking the name of the GUI. Opening the figure (the *.fig) file just opens the figure and it does not perform any of the initializations that are necessary/needed for using the GUI.
0 Comments
See Also
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!