Advertisement
Guest User

Untitled

a guest
May 5th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. function I = Mtrap(a,b,n,fx)
  2.  
  3. sum = fx(1,1);
  4. for i = 1:n-1
  5. sum = sum+2*fx(i,1);
  6. end
  7. sum = sum+fx(n,1);
  8. I = ((b-a)/2)*sum;
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement