This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: b = [pi/9, sqrt(3)/2 sqrt(3)/2 pi/9]; N = length(d); x = zeros(N,1); for k = 2:N d(k) = d(k)  u(k1)*l(k)/d(k1); b(k) = b(k)  b(k1)*l(k)/d(k1); end x(N) = b(N)/d(N); for k = N1:1:1 x(k) = (b(k)  u(k)*x(k+1))/d(k); end display(x) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Section 2.7 3 The answer from matlab is below x = 0.018336695058824 0.035006775977942 0.048317587771715 0.056523986874421 0.057801073272040 0.050215676439535 0.031696149551397 The code is here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 %% section 2.7 3 clear clc close all M = 8; N = M1; h = 1/M; l = 1*ones(N,1); l(1) = 0; d = ones(N,1)*(2+h^2); u = 1*ones(N,1); u(end) = 0; b = (h:h:N*h)*h^2; x = zeros(N,1); for k = 2:N d(k) = d(k)  u(k1)*l(k)/d(k1); b(k) = b(k)  b(k1)*l(k)/d(k1); end x(N) = b(N)/d(N); for k = N1:1:1 x(k) = (b(k)  u(k)*x(k+1))/d(k); end display(x) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Created by Jianjian Gao 2010/10/12...
View
Full Document
 Spring '08
 Rottman
 Trapezoid, leftendpoint rectangular rule

Click to edit the document details