t=[0:100];x=exp(-t).*sin(t);
response=input('type min,max,or sum.','s');
response=upper(response);
switch response
case 'MIN'
mininum=min(x)
case 'MAX'
maxinum=max(x)
case 'SUM'
total=sum(x)
otherwise
disp('you have not enter a proper choice.')
end
如上修改