Evaluate numerical Integral by generating function
Show older comments
I want to evaluate numerically a double integral of a function.
The function is generated from a series of steps. My doubt is how to handle the variable, while generating the function.
The function is generated from a series of many steps. For example, I am giving a small version of it, where I tried by using handles but I am getting errors. Kindly let me know the correct way of doing it.
ss = 10^-8;
sd = 10^-11;
ber_link = 0;
tn = 6;
ma = [1,1;1,-1;1,0;-1,1;-1,-1;-1,0];
p = [.9,.01,.01,.01,.01,.01];
for j = 1:tn
x = 0;
x = x+ma(j,2)*ss;
if ma(j,1) == 1
a = @(ln1, ln2) (ss*ln1+x*ln2)/sd;
else
a = @(ln1, ln2) (ss*ln1-x*ln2)/sd;
end
cpd = @(ln1, ln2) qfunc(a);
pro = @(ln1, ln2) cpd*p(j);
bl = @(ln1, ln2) bl+pro;
end
bl = @(ln1,ln2) bl.*exp((-(ln1-3).^2)/2*36).*exp((-(ln1-3).^2)/2*36);
int = integral2(bl, 1, Inf, 1, Inf)
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!