How to get data from edit text box in GUI with a push button
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Geoff Hayes
2017 年 4 月 4 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!