From: "Carla Soares" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: help on triple integral
Date: Mon, 5 Jul 2010 16:48:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <i0t2cj$m4p$>
References: <i0amlt$e1b$> <i0oqng$lm1$>
Reply-To: "Carla Soares" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1278348499 22681 (5 Jul 2010 16:48:19 GMT)
NNTP-Posting-Date: Mon, 5 Jul 2010 16:48:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2400761
Xref: comp.soft-sys.matlab:650504

Thanks for your reply! I'm sorry, but I don't get it completly... I now have:

    for x=-A:R-A;
        int1 = @(y,z) (-alpha*(cdf(max(0,max(0,max(0,R-max(0,A+x))-max(0,A+x+y))-max(0,A+x+y+z))))).*pdf(z).*pdf(x).*pdf(y);
        ymin = -1e5;
        ymax = max(0,R-max(0,A+x));
        zmax = @(y) max(0,max(0,R-max(A+x))-max(0,A+x+y));
        int2 = quad2d(int1,ymin,ymax,ymin,zmax);

int1 is my original integrand with the 3 variables. A and R are changing values in another loop and cdf and pdf are functions handles for the cdf and pdf of the normal.
But this gives me a value (and I guess only for the last assumed value of x), I don't see how I get to integrate over x...
Sorry if this is very basic, but I'm not managing to figure it out...