%% Parameterized Function
%
% Create the function f(x) = 1/(x^{3} - 2x - c) with one parameter, c.

fun = @(x,c) 1./(x.^3-2*x-c);

%
% Evaluate the integral from x=0 to x=2 at c=5.

q = integral(@(x) fun(x,5),0,2)

% See Parameterizing Functions for more information on this technique.
% Copyright 2019 The MathWorks, Inc.