f=@(x,y) 2000*log(140000/(140000-2100*x))-9.8*x; n=input ("Segment size:"); a=input ("Lower limit:"); b=input ("Upper limit:"); h=(b-a)/n; s=0.0; for i=1:n-1 s=s+(f(a+i*h)); printf("s= %d\n",s); end I=(h/2)*(f(a)+2*s+f(b)); printf("The exact value of the above integral is=%f\n",I);