Home > Src > Level_0 > legendre_pol.m

legendre_pol

PURPOSE ^

LEGENDRE_POL plots Legendre polynomials for n=0,...,4

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 LEGENDRE_POL  plots Legendre polynomials for n=0,...,4

 Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
                    "Spectral Methods. Fundamentals in Single Domains"
                    Springer Verlag, Berlin Heidelberg New York, 2006.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % LEGENDRE_POL  plots Legendre polynomials for n=0,...,4
0002 %
0003 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang,
0004 %                    "Spectral Methods. Fundamentals in Single Domains"
0005 %                    Springer Verlag, Berlin Heidelberg New York, 2006.
0006 
0007 %   Written by Paola Gervasio
0008 %   $Date: 2007/04/01$
0009 
0010 nx=100;
0011 x=linspace(-1,1,nx);
0012 x=x';
0013 
0014 % Legendre
0015 n=4;
0016 pn=pnleg_all(x,n);
0017 
0018 figure(1);
0019 clf
0020 set(gca,'Fontname','Times','Fontsize',16);
0021 plot(x,pn(:,1),'k--','Linewidth',1);
0022 hold on
0023 plot(x,pn(:,2),'k',x,pn(:,3),'k--','Linewidth',1);
0024 plot(x,pn(:,4),'k-.','Linewidth',1);
0025 plot(x,pn(:,5),'k:','Linewidth',2);
0026 xlabel('x','Fontname','Times','Fontsize',16);
0027 set(gca,'PlotBoxAspectRatio',[3 2 1],...
0028     'Ylimmode','manual','Ylim',[-1.2,1.2],...
0029    'Xtickmode','manual','Xtick',[-1,-0.5,0,0.5,1],...
0030     'Xgrid','on','Xminorgrid','off',...
0031     'Ygrid','on','Yminorgrid','off',...
0032     'Fontname','Times','Fontsize',16);

Generated on Fri 21-Sep-2007 10:07:00 by m2html © 2003