domdealm

TRAPEZIOS

Jul 12th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.26 KB | None | 0 0
  1. clear all, close all, clc, help trapezios.m
  2. N=6; Li=3.0;Ls=3.6;h=(Ls-Li)/N;
  3. x=Li:h:Ls;y=1./x;I=0;
  4. disp('DIVISAO DE SUBINTERVALOS')
  5. for i=1:N
  6.     A=[i,i+1];disp(num2str(A));
  7.     I=I+(h/2)*(y(i)+y(i+1));
  8. end
  9. disp(' ');disp(['A integral vale:' num2str(I)]);
Add Comment
Please, Sign In to add comment