1x32x5dx, (from 0 to 1)

write a function myfun that computes theintegrand:

function y = myfun(x) 
y = 1./(x.^3-2*x-5);

Then pass @myfun, a function handle to myfun,to quad, along with the limits of integration, 0 to 2:

Q = quad(@myfun,0,2)

Q =

   -0.4605

Alternatively, you can pass the integrand to quad asan anonymous function handle F:

F = @(x)1./(x.^3-2*x-5);
Q = quad(F,0,2); 

相关文章:

  • 2021-07-01
  • 2021-10-15
  • 2021-07-17
  • 2022-12-23
  • 2021-04-03
  • 2021-04-03
  • 2021-09-20
猜你喜欢
  • 2021-11-18
  • 2021-10-31
  • 2022-12-23
  • 2021-07-09
  • 2021-06-16
  • 2022-12-23
  • 2021-04-16
相关资源
相似解决方案