button to activate textboxes in GUI
2 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
William
2011 年 9 月 20 日
Use this:
exportwhatever = get(handles.("textboxname"),'string')
Put this code in the function callback. It will go to the text box and return in string format what is in the textbox.
2 件のコメント
Matthew
2019 年 7 月 22 日
I used the function above but I still get an error:
"Undefined variable "handles" or class "handles.text1". Text1 is the tag of my textbox. But, i do not understand how to access the handles from my textbox.
I tried
set(handles.text1, 'String', works);
where works is just a string. So, how do I get to recognize "handles" from my textbox in my button callback function
その他の回答 (1 件)
Grzegorz Knor
2011 年 9 月 20 日
You have to create callback function:
2 件のコメント
Grzegorz Knor
2011 年 9 月 20 日
function test
uicontrol('Style','pushbutton','String','read','callback',@pb_clbck)
h = uicontrol('Style','Edit','String','write me!',...
'Units','normalized','Position',[.4 .45 .2 .1]);
function pb_clbck(src,evnt)
disp(get(h,'String'))
end
end
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!