function [c,a] = char_values(n) % % function c = char_values(n) % % Produces the approximations to the characteristic values of % 2 % d u(x) 2 % ------- + k u(x) = 0, u(0) = 0 and u(1) = 0. % 2 % d x % % via finite difference method for the partition in n subintervals % h = 1/n; a = diag(2*ones(1,n-1))-diag(ones(1,n-2),-1)-diag(ones(1,n-2),+1); e = eig(a); c2 = e/h^2; c = sqrt(c2);