None.
Open in the MATLAB editor: d02uz_example
function d02uz_example fprintf('d02uz example results\n\n'); n = int64(16); m = 9; a = -0.24*pi; b = pi/2; % Set up Chebyshev grid [x, ifail] = d02uc(n, a, b); % Evaluate function on grid.and get interpolating Chebyshev coefficients f = x + exp(-x); [c, ifail] = d02ua(n, f); % Evaluate Chebyshev series manually by evaluating each Chebyshev % polynomial in turn at new equispaced (m+1) grid points. % Chebyshev series on [-1,1] map of [a,b]. dmap = 2/(m-1); xmap = [-1:dmap:1]; deven = (b-a)/(m-1); xeven = [a:deven:b]; fprintf(' x_even x_map Sum(f)\n'); for i=1:m for k=int64(0:n) [t(k+1), ifail] = d02uz(k, xmap(i)); end fseries(i) = dot(c,t); end fprintf('%10.4f %10.4f %10.4f\n', [xmap xeven fseries]');
d02uz example results x_even x_map Sum(f) -1.0000 -0.7500 -0.5000 -0.2500 0.0000 0.2500 0.5000 0.7500 1.0000 -0.7540 -0.4634 -0.1728 0.1178 0.4084 0.6990 0.9896 1.2802 1.5708 1.3715 1.1261 1.0158 1.0067 1.0731 1.1961 1.3613 1.5582 1.7787