No BSD License  

Highlights from
Introduction à Matlab (deuxième édition)

from Introduction à Matlab (deuxième édition) by Jean-Thierry
tous les m-fichiers relatifs à la deuxième édition de l'Introduction à Matlab

estcheb.m
f = inline('sin(x)./(1+x.*x)');
[c, m]=tchebcoef(0,10*pi,f,50,1.0E-2);
x = linspace(0,10*pi,5000);

subplot(2, 2, 1);  % divise l'cran en 4 et se place dans le quart haut gauche
y =f(x);
y1 = tchebeval(0,10*pi,c,2,x);
plot(x, y, 'y-.', x, y1, 'y-'); 
title('m = 2','fontsize',20);
axis([0,10*pi,-0.2,0.5]);
max(y-y1)
subplot(2, 2, 2);  % se place dans le quart haut droit
y1 = tchebeval(0,10*pi,c,4,x);
plot(x, y, 'y-.', x, y1, 'y-'); 
title('m = 4','fontsize',20);
axis([0,10*pi,-0.2,0.5]);
max(y-y1)
subplot(2, 2, 3);  % se place dans le quart bas gauche
y1 = tchebeval(0,10*pi,c,12,x);
plot(x, y, 'y-.', x, y1, 'y-'); 
title('m = 12','fontsize',20);
axis([0,10*pi,-0.2,0.5]);
max(y-y1)
subplot(2, 2, 4);  % se place dans le quart bas gauche
y1 = tchebeval(0,10*pi,c,23,x);
plot(x, y, 'y-.', x, y1, 'y-'); 
title('m = 23','fontsize',20);
axis([0,10*pi,-0.2,0.5]);
max(y-y1)
print -deps2 estcheb.eps

Contact us at files@mathworks.com