MATLAB Function Reference Previous page   Next Page
triplequad

Numerically evaluate triple integral

Syntax

Description

triplequad(fun,xmin,xmax,ymin,ymax,zmin,zmax) evaluates the triple integral fun(x,y,z) over the three dimensional rectangular region xmin <= x <= xmax, ymin <= y <= ymax, zmin <= z <= zmax. fun is a function handle. See Function Handles in the MATLAB Programming documentation for more information. fun(x,y,z) must accept a vector x and scalars y and z, and return a vector of values of the integrand.

Parameterizing Functions Called by Function Functions, in the MATLAB mathematics documentation, explains how to provide additional parameters to the function fun, if necessary.

triplequad(fun,xmin,xmax,ymin,ymax,zmin,zmax,tol) uses a tolerance tol instead of the default, which is 1.0e-6.

triplequad(fun,xmin,xmax,ymin,ymax,zmin,zmax,tol,method) uses the quadrature function specified as method, instead of the default quad. Valid values for method are @quadl or the function handle of a user-defined quadrature method that has the same calling sequence as quad and quadl.

Examples

Pass M-file function handle @integrnd to triplequad:

where the M-file integrnd.m is

Pass anonymous function handle F to triplequad:

This example integrates y*sin(x)+z*cos(x) over the region 0 <= x <= pi, 0 <= y <= 1, -1 <= z <= 1. Note that the integrand can be evaluated with a vector x and scalars y and z.

See Also

dblquad, quad, quadl, function handle (@), anonymous functions


Previous page  trimesh  triplot Next page

© 1994-2005 The MathWorks, Inc.