Code covered by the BSD License  

Highlights from
Chebpack

image thumbnail

Chebpack

by

 

15 Jul 2011 (Updated )

The MATLAB package Chebpack solves specific problems for differential or integral equations.

X=mult(n,dom)
function X=mult(n,dom)
% X: the "multiplication by x" matrix (sparse)
% n: dimension of the matrix, dom: the domain [a,b]
%
%    Written by Damian Trif, 2011
%
e1=ones(n,1)/2;e2=e1;e2(2)=1;
X=spdiags([e1,e2],[-1,1],n,n);
alpha=(dom(2)-dom(1))/2;beta=(dom(2)+dom(1))/2;
X=alpha*X+beta*speye(n);

Contact us