function [U] =trial(x,n) % % Calculates the first n trial functions on [-1,1]; % we assume implicitly that the vector x is a row vector % % U_1 = (1-x)/2 % U_2 = (1+x)/2 % U_n = \sqrt{(2n-3)/2}\int_{-1}^x L_{n-2}(t) dt if n \ge 3 % U(1,:) = (1-x)/2; U(2,:) = (1+x)/2; if n >2 [P] = legtable(x,n); for i = 3:n ip=i-2; U(i,:) = sqrt((2*i-3)/2)*1/(2*ip+1)*(P(ip+2,:)-P(ip,:)); end; end;