Code covered by the BSD License  

Highlights from
LaguerreEig

image thumbnail
from LaguerreEig by Damian Trif
Calculates numerical eigenvalues and eigenfunctions of Schroedinger problems on (0,infinity).

siyyam1.m
n=128;
[x,w]=pd(n);t=x2t(n,x);D=deriv(n);X=mult(n);
A=D^3+3*D^2+(3*eye(n)+2*X)*D+(2*eye(n)+2*X);
A(n-2,:)=ones(1,n);
A(n-1,:)=sum(D);A(n,:)=sum(D^2);
B=t'\(exp(-x).*((1-2*x).*sin(x)+cos(x)));
B(n-2)=1;B(n-1)=-1;B(n)=0;
c=A\B;
rez=(t'*c).*exp(x)-cos(x);
ind=find(x<10);
plot(x(ind),rez(ind));

Contact us at files@mathworks.com