y=@(x)1./(x.^3-2*x-5);
Q=quad(y,0,2);
or
% function in m-file: myfun.m
function y =myfun(x), y=1./(x.^3-2*x-5); end
% use myfun function
>> Q=quad(@myfun,0,2)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!