%% Triple Integral with Finite Limits
% Define the anonymous function f(x,y,z) = y \sin x + z \cos x.

fun = @(x,y,z) y.*sin(x)+z.*cos(x)

%
% Integrate over the region 0 \le x \le \pi, 0 \le y \le 1, and -1 \le z \le 1.

q = integral3(fun,0,pi,0,1,-1,1)

% Copyright 2012 The MathWorks, Inc.