Guest User

Untitled

a guest
Oct 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. function erg2=trapez(a,b,n,f)
  2. h=(b-a)/n;
  3. tmp=0;
  4.  
  5. for j=1:n
  6. mop=a+(j-1)*h;
  7. tmp=tmp+f(mop);
  8. end
  9.  
  10. erg2=(h/2)*(f(a)+2*tmp+f(b));
  11.  
  12. end
Add Comment
Please, Sign In to add comment