I am trying to evaluate an integral over a function that includes another integral. The target variable for the outside integral is an endpoint of the inside integral. Here are the key pieces of code:
exp1 = @(ca,ma,sa) ca.*normpdf(ca,ma,sa); exp2 = @(c1b,m2b,s2b) c1b.*normcdf(c1b,m2b,s2b) + integral(@(ca)exp1(ca,m2b,s2b),c1b,100);EU_prior = (integral(@(c1b) exp2(c1b,mu2,sig2a),-100,c1b_pr)-s2)*normcdf(c1b_pr,mu1,sig1);
As far as I can tell, the problem is that c1b is an endpoint of the integral in exp2.
The primary error is "Error using integral (line 85) A and B must be floating-point scalars."
Thanks in advance for any help.
Brian
Best Answer