how to take a nintegral in matlb code example Example: integral in matlab fun = @(x) exp(-x.^2).*log(x).^2; q = integral(fun,xmin,xmax)