| |
| | [No title] (Site not responding. Last check: 2007-10-22) |
 | | function [answer, table] = romberg(tvalues,r) % romberg: carries out Romberg integration using a sequence of trapezium % rule estimates as input. |
 | | % % Usage: [answer, table] = romberg(tvalues) % Inputs: tvalues a list of trapezium rule estimates, each one produced with % twice the number of intervals as the previous one. |
 | | Type return to stop.'; else len = length(tvalues); table = zeros(len,len); table(:,1) = tvalues(:); for j = 1:len-1 for k = j+1:len table(k,j+1) = ((r^j)*table(k,j) - table(k-1,j)) / (r^j -1); end end disp('The Romberg integration table is: ') disp(table); answer = table(len,len); pstr='Provide another trapezium rule estimate if you wish. |
| www.math.ucalgary.ca /~westbroo/amat491/mscripts/romberg.m (148 words) |
|