Matlab GUI editboxes and pushbuttons multiple choice question % Question{12}: Gi
ID: 3828411 • Letter: M
Question
Matlab GUI editboxes and pushbuttons multiple choice question
% Question{12}: Given ClickMeButton and HelloEditBox on MyFirstGUI, to
% update the textbox when the button is clicked, code would be written in...
% A. ClickMeButton_CreateFcn
% B. HelloEditBox_CreateFcn
% C. ClickMeButton_Callback
% D. HelloEditBox_Callback
% E. MyFirstGUI_OpenFcn
Answer{12}='';
% Question{13}: Given ClickMeButton and HelloEditBox, to update the textbox
% when the button is pushed, code would be written similar to...
% A. set(hObject,'string','Hello Gregory!');
% B. set(handles.HelloEditBox,'string','Hello Gregory!');
% C. set(handles.HelloEditBox,'data','Hello Gregory!');
% D. set(hObject,'data','Hello Gregory!');
% E. set(handles.ClickMeButton,'string','Hello Gregory!');
Answer{13}='';
Explanation / Answer
12. C) ClickMeButton_Callback
Because on the event of buton click the text in the textbox has to be updated.So the code has to be written in the background of Button Onclick Event.
13. E) set(handles.ClickMeButton,'string','Hello Gregory!')
Because,Code should be written behind the button on which the Onclick event happens.So the syntax would be as follows :
Set(handles.ButtonName,'String','data')