?? legndr.m
字號:
function p = legndr(n,x)
% Legendre polynomials function
% Inputs
% n = Highest order polynomial returned
% x = Value at which polynomial is evaluated
% Output
% p = Vector containing P(x) for order 0,1,...,n
%* Perform upward recursion
p(1)=1; % P(x) for n=0
if(n == 0) return; end
p(2)=x; % P(x) for n=1
for i=3:n+1 % Use upward recursion to obtain other n's
p(i) = ((2*i-3)*x*p(i-1) - (i-2)*p(i-2))/(i-1);
end
return;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -