I want to compute a numerical integration problem, the code for which is as follows
It gives the following error message:
Error using normpdf (line 36)
Non-scalar arguments must match in size.
Error in @(x)prod(normpdf(samps,mu,x))
But when I evaluate func at x=1, it works fine. So, I don't know how to fix this error.