%Example - 1
% --- Executes on button press in pushbutton1
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Set text in textbox1 on pushbutton1 action
set(handles.textbox1,'string','New Text here on clicking pushbutton1');
%Example - 2
% --- Executes on button press in pushbutton1
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Set text in textbox1 on pushbutton1 action - Convert number to string
% --- Executes on button press in pushbutton1
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Set text in textbox1 on pushbutton1 action
set(handles.textbox1,'string','New Text here on clicking pushbutton1');
%Example - 2
% --- Executes on button press in pushbutton1
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Set text in textbox1 on pushbutton1 action - Convert number to string
intNum=5999;
% var intNum need to be converted to a string
strintNum = num2str(intNum);
set(handles.textbox1,'string',strintNum);
No comments:
Post a Comment