Example:
Q = quad(@myfun,0,2);
where myfun.m is the M-file function:
%-------------------%
function y = myfun(x)
y = 1./(x.^3-2*x-5);
%-------------------%
or, use a parameter for the constant:
Q = quad(@(x)myfun2(x,5),0,2);
where myfun2 is the M-file function:
%----------------------%
function y = myfun2(x,c)
y = 1./(x.^3-2*x-c);
%----------------------%