legroots.m

来自「matlab6矩阵微分工具 matlab6矩阵微分工具」· M 代码 · 共 12 行

M
12
字号
function r = legroots(N);%  The function r = legroots(N) computes the roots of the %  Legendre polynomial of degree N.%  J.A.C. Weideman, S.C. Reddy 1998.n = [1:N-1];                   %  Indicesd = n./sqrt(4*n.^2-1);         %  Create subdiagonalsJ = diag(d,1)+diag(d,-1);      %  Create Jacobi matrixr = sort(eig(sparse(J)));      %  Compute eigenvalues

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?