Professional Documents
Culture Documents
1 mtlab final
celcius=str2num(get(handles.edit1,'String'));
handles.celcius=celcius;
guidata(hObject,handles);
kelvin=str2num(get(handles.edit2,'String'));
handles.kelvin=kelvin;
guidata(hObject,handles);
reamur=str2num(get(handles.edit3,'String'));
handles.reamur=reamur;
guidata(hObject,handles);
fahrenheit=str2num(get(handles.edit4,'String'));
handles.fahrenheit=fahrenheit;
guidata(hObject,handles);
pusbotton (cari)
reamur=handles.celcius*(4/5);
set(handles.edit3,'String',reamur);
fahrenheit=handles.celcius*(9/5)+32;
set(handles.edit4,'String',fahrenheit);
kelvin=handles.celcius+273;
set(handles.edit2,'String',kelvin);
pusbotton (exit)
delete(handles.figure1)
No.2 FINAL
pushbotton
x = str2double(get(handles.edit1,'String'));
if x<=20
set (handles.edit2,'String','E');
elseif x>=21 & x<=40
set (handles.edit2,'String','D');
elseif x>=41 & x<=60
set (handles.edit2,'String','C');
elseif x>=61 & x<=80
set (handles.edit2,'String','B');
else
set (handles.edit2,'String','A');
end;