func = @(x) 1/(6*x*x*x) mx= 9; mi = 1; n = 20; h=(mx-mi)/n; result = 0; for i=1:n x0=mi+(i-1)*h; x1=mi+(i*h); result=result+(func(x0)+ func(x1))*h/2; end disp(['estimitted integral:', num2str(result)]);