📄 x2t.m
字号:
function t=x2t(n,x,dom)
% a<=x<=b, dom=[a,b]
% Calculates the vector t=[T0/2;T1(csi);T2(csi);...;Tn(csi)]
% where csi=2/(b-a)*(x-(b+a)/2), -1<=csi<=1
% Following A. J. MacLeod, An automatic matrix approach to the
% Chebyshev series solution of differential equations
% http://maths.paisley.ac.uk/allanm/amcltech.htm
%
x=x(:)';
csi=2/(dom(2)-dom(1))*(x-(dom(2)+dom(1))/2);
if n>=1 t(1,:)=ones(1,length(x))/2;end;
if n>=2 t(2,:)=csi;end;
if n>=3 t(3,:)=2*csi.^2-1;end;
if n>=4 for i=4:n
t(i,:)=2*csi.*t(i-1,:)-t(i-2,:);
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -