matlab code rayleigh ritz
4f\n', lambda_sorted(1)); % Plot the fundamental mode c = coeffs_sorted(:, 1); approx_eigenfunction = zeros(1, length(x)); for i = 1:n approx_eigenfunction = approx_eigenfunction + c(i) phi(i, :); end figure; plot(x, approx_eigenfunction, 'LineWidth', 2); tit