rbmatlab 0.10.01
demos/demo_quadratures.m
Go to the documentation of this file.
00001 function qres = demo_quadratures(pdeg,qdeg)
00002 %function qres = demo_quadratures(pdeg,qdeg)
00003 % small script demonstrating interval integration of polynomials
00004 % of degree 'pdeg' with quadratures of degreed 'qdeg'
00005 %
00006 % Parameters:
00007 %  pdeg: polynomial degree (default = 25)
00008 %  qdeg: quadrature degree (default = 23)
00009 %
00010 % Return values:
00011 %  qres: a matrix with the integration results
00012 
00013 % Bernard Haasdonk 28.8.2009
00014 
00015 help demo_quadratures;
00016 
00017 if nargin < 2
00018   qdeg = 23;
00019 end;
00020 if nargin < 1
00021   pdeg = 25;
00022 end;
00023 qres = zeros(pdeg+1,qdeg+1);
00024 for d=0:pdeg
00025   f = @(x) x.^d;
00026   for q = 0:qdeg
00027     qres(d+1,q+1)=intervalquadrature(q,f);
00028   end;
00029 end;
00030 
All Classes Namespaces Files Functions Variables