2
a=2;
b=9;

syms x
I0=besseli(0,a*x/b);

F(x)=(x/b)*exp(-(x^2+a^2)/(2*b));
FUN=x*F(x);

mean=quad(FUN,0,100)

我得到这个错误:

Error using fcnchk (line 107)
If `FUN` is a MATLAB object, it must have an feval method.

Error in quad (line 57)
f = fcnchk(funfcn);
4

1 回答 1

1

The argument FUN to quad has to be a function, however you are providing a symbolic expression instead.

Try using FUN = matlabFunction(x*F(x)) to convert your expression to a function.

See also this post.

于 2013-10-31T17:15:27.330 回答