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)

And i get this error:

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);
3lectrologos
  • 9,469
  • 4
  • 39
  • 46
user2942388
  • 35
  • 1
  • 2
  • 3

1 Answers1

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.

Community
  • 1
  • 1
3lectrologos
  • 9,469
  • 4
  • 39
  • 46