www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ParameterizedFunctionExample.m

    %% 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)