I would suggest the following:
k = linspace(a,b);
x = c:0.01:d;
[X,K] = meshgrid(x,k)
y = arrayfun(@(p,t) normcdf(p, b0+b1*t, sigma), K(:), X(:))
res = cumtrapz(x,y)
Untested though as you gave no example data and desired results. Maybe you need to swap the order of x
and k
as well as X
and K
to get the desired result. (or use ndgrid
instead of meshgrid
, has the same effect)