MATLAB: Which packages do I need to use ‘integral’ function

integralundefined function

which packages do I need to use 'integral' function? I type it on command line in 2011b and get an "Undefined function" error
>> fun = @(x) exp(-x.^2).*log(x).^2;
>> q = integral(fun,0,Inf)
Undefined function 'integral' for input arguments of type 'function_handle'.

Best Answer

use function quadgk
eg
>> fun = @(x) exp(-x.^2).*log(x).^2;
>> quadgk(fun,0,inf)
ans =
1.9475