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