You are on page 1of 2

% --- Executes on button press in pushbutton2.

Function pushbutton2_Callback(hObject, eventdata, handles)

Set(handles.edit1, ‘String’, ‘ ‘);

Set(handles.edit2, ‘String’, ‘ ‘);

Set(handles.edit3, ‘String’, ‘ ‘);

Set(handles.edit4, ‘String’, ‘ ‘);

Set(handles.edit5, ‘String’, ‘ ‘);

Set(handles.edit6, ‘String’, ‘ ‘);

% hObject handle to pushbutton2 (see GCBO)

% eventdata reserved – to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

% --- 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

% handles structure with handles and user data (see GUIDATA)

% lecture des valeurs d’entrée

A = str2num(get(handles.edit1, ‘String’));

B = str2num(get(handles.edit2, ‘String’));

% calcul des valeurs de sortie

C = a + b;

D = a – b;

E = a*b;

F = a/b;
% affichage des valeurs de sortie

Set(handles.edit3, ‘String’, num2str©);

Set(handles.edit4, ‘String’, num2str(d));

Set(handles.edit5, ‘String’, num2str€);

Set(handles.edit6, ‘String’, num2str(f));

You might also like