Try this piece of code, which works fine.
a=1;b=2;% A two-variate function
f2= @(x,y) x+y;derivedF2=@(x) integral(@(y) f2(x,y), a,b);% Test the evaluation of the derived function handle
derivedF2(0);% Test the integration of the derived function handle
% integralVal=integral(derivedF2,a,b);
% integralVal=integral(@(x) derivedF2(x),a,b);
% Test plotting of the derived function handle
figure(11);ezplot(@(x) arrayfun(derivedF2,x));
But if you uncomment the lines starting with integralVal. The code breaks.
Apparently, the derived function handle does not support integration operation, or have I missed something?
Best Answer