Graphics Programs Reference
In-Depth Information
MATLAB Functions
I = quad(func,a,b,tol)
uses adaptive Simpson's rule
=
a
f
(
x
)
dx
with an error tolerance
tol
(default is 1.0e-6). To speedupexecution,
vectorize the computation of
func
by using array operators .*, ./ and .ˆ in the
definition of
func
.For example, if
f
(
x
)
for evaluating
I
x
3
sin
x
=
+
1
/
x
,specify the functionas
function y = func(x)
y = (x.ˆ3).*sin(x) + 1./x
I = dblquad(func,xMin,xMax,yMin,yMax,tol)
uses
quad
to integrate overa
rectangle:
yMax
xMax
I
=
f
(
x
,
y
)
dx dy
yMin
xMin
I = quadl(func,a,b,tol)
employs adaptive Lobatto quadrature (this methodis
not discussedinthis topic). It is recommendedif very high accuracyis desired
and the integrand issmooth.
There are nofunctionsfor Gaussian quadrature.
Search WWH ::
Custom Search