"Angie" <firstname.lastname@example.org> wrote in message <email@example.com>... > First: In the above post, I should have normcdf(x,0,1) not normcdf(x,1,0) > > Second: I tried this approach in another post, yet I am not sure if this is correct. Can anyone tell me if this is correct? > > fun1 = @(x) x; > fun2 = @(x) normcdf(x,0,1); > myintegrand = @(x) fun1(x).*fun2(x); > quad(myintegrand,0,1) > > ans = > 0.3710 - - - - - - - - - Yes, that agrees with the answer I got using integration by parts with old-fashioned pen and paper, namely:
1/4 + 1/2/sqrt(2*pi*exp(1)) = 0.370985362
I would have thought the symbolic toolbox could also solve this.