% RunSimpson.m % This runs Simpson's adaptive method recursive program. % Edit this file and drop it in my p-drive along with Simpson.m which you % must write. % My name is: % What I did to improve the efficency was % 1) % 2) % 3) clear % clears all variables clc % clears the command window format long % displays outputs with 15 decimal places f = inline('cos(2*x)/exp(x)'); a = 0; b = 2*pi; eps = 10^(-3); level = 0; levelmax = 20; % After you have written Simpson.m, % uncomment and edit (if necessary) the following: % Simpson(f,a,b,eps,level,levelmax)