clc;
clear all;
close all;
prompt = {'请输入数字:'};
dlg_title = '输入 ';
num_lines = 1;
def = {'3.6'};
t = inputdlg(prompt,dlg_title,num_lines,def);
tt=str2num(t{1,1});
if tt>0
if (tt-fix(tt))>0.5
if (tt-fix(tt)-0.5)/2>0.125
tn=fix(tt)+1
else
tn=fix(tt)+.5
end
else
if (tt-fix(tt))/2>0.125
tn=fix(tt)+.5
else
tn=fix
end
end
end
h = msgbox(strcat(num2str(tt),'四舍五入结果为:',num2str(tn)));