Home > tt2 > exp > ffejer2.m

ffejer2

PURPOSE ^

Fejer

SYNOPSIS ^

function [x,w]=ffejer2(N, a, b)

DESCRIPTION ^

Fejer


 TT-Toolbox 2.2, 2009-2012

This is TT Toolbox, written by Ivan Oseledets et al.
Institute of Numerical Mathematics, Moscow, Russia
webpage: http://spring.inm.ras.ru/osel

For all questions, bugs and suggestions please mail
ivan.oseledets@gmail.com
---------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [x,w]=ffejer2(N, a, b)
0002 %Fejer
0003 %
0004 %
0005 % TT-Toolbox 2.2, 2009-2012
0006 %
0007 %This is TT Toolbox, written by Ivan Oseledets et al.
0008 %Institute of Numerical Mathematics, Moscow, Russia
0009 %webpage: http://spring.inm.ras.ru/osel
0010 %
0011 %For all questions, bugs and suggestions please mail
0012 %ivan.oseledets@gmail.com
0013 %---------------------------
0014 
0015 N2 = N+1;
0016 x = a+(b-a)*0.5*(cos(pi*(0:N2)/N2)+1)';
0017 x = x(2:N+1);
0018 w = zeros(N2,1);
0019 
0020 for i=0:N2
0021     curw = 0;
0022     for j=1:floor(N2/2)
0023         curw = curw + sin((2*j-1)*i*pi/N2)/(2*j-1);
0024     end;
0025     w(i+1)=curw*4/N2*sin(i*pi/N2);
0026 end;
0027 w = w(2:N+1);
0028 w = w*(b-a)/2;
0029 
0030 end

Generated on Wed 08-Feb-2012 18:20:24 by m2html © 2005