title: MATLAB - solving the integral with bessel function
body: <p>I'm trying to solve the integral of variable x (from 0 to Inf) which is the function of variable S. I want to solve this integral and find the vector of results dependent on variable S. <a href="https://i.stack.imgur.com/SVb8K.png" rel="nofollow noreferrer">integral</a></p>
  <p>I want to then approximate this function by polyfit (to have a function E(S))</p>
  <blockquote>
  <pre><code>nu=0; int_val=zeros([255,1]); for i=1:10
  S=i/100;
  %besselj(0,S*2)
  fun = @(x)log(abs(x-(pi/2)^2.*(-S.^2/2))).*x.*exp((x.^2+S.^2)/2).*besselj(nu,S.*x);
  int_val(i) = integral(fun,0,Inf); end
  </code></pre>
  </blockquote>
  <p>Unfortunately, the MATBAL calculates only NaN number. It isvery important for me.. Please, help.</p>