EDfTOR
y Editor - C:\Users\Adi\Documents\MATLAB\kalkulator.m
Insert gL J* Q Comment %
Breakpoints
[>| Run Section o lii Advance
New Open Save
Find Files Compare Sprint -
NAVIGATE
FILE
Indent
EDIT
BREAKPOINTS
Run Run and ▼ Advance
Run and Time
RUN
U
kalkulator.m
72
73 -
74
% Get default command linę output from handles 3tructure varargout{l} = handles.output;
75
76
77
78
79
80
% --- Executes on button press in pushbuttonl.
!function pustouttonl_CallbacIę(hObject, eventdata, handles)
% hObject handle to pushbuttonl (see GCBO)
% eventdata reserved - to be defined in a futurę version of MATLAB
DATA)
angka_pertair.a = str2double (get (handles. editl, ' String')) ; angka_kedua = str2double(get(handles.edit2,'String')); operator = get (handles .popuprr.enul, 'Value ') ;
if operator == 1
hasil = angka_pertarr.a + angka_kedua; elseif operator == 2
hasil = angka_pertair,a - angka_kedua; elseif operator == 3
hasil = angka_pertarr.a * angka_kedua; elseif operator == 4
hasil = angka_pertair.a / angka_kedua;
end
set(handles.edit3,'String',num2str(hasil))
function editl__Callback (hObject, eventdata, handles)
^]% hObject handle to editl (see GCBO)
% eventdata reserved - to be defined in a futurę version of MATLA3 % handles structure with handles and user data (see GUIDATA)
t
kalkulator / pushbuttonl_Callback
Ln 91 Col 21