function main clear all %OK in main function afun = inline('exp(t)./(t.^3+1)','t'); tstep = .1; %time increment tmax = 10; %max time value to consider %method 1 - trapz tic; t = 0:tstep:tmax; a = afun(t); %compute a for all values of t v0 = -2; %initial velocity n=1; v = v0; %current velocity at t(n) while (v<10 & n10); if (length(ii)>0) n = ii(1); else n = length(t); end printans(vv(n),t(n),'cumtrapz'); %method 3 - quad8 tic; tt = 0; v = v0; while (v<10 & tt