Documente Academic
Documente Profesional
Documente Cultură
F = inline(input("Ingresa la funcion"));
xi = input("Ingresa el acote inferior (a)");
xf = input("Ingresa el acote superior (b)");
np = 3;
h = (xf-xi)/(3);
x = [xi:h:xf];
n = size(x,2);
Int = 0;
j = 0;
i = 1; %?
%for i=1:3:n-1
j = j + 1;
I(j) = (3/8)*h*(F(x(i))+3*F(x(i+1))+3*F(x(i+2))+F(x(i+3)));
Int = Int + I(j);
%salida1 =['Particion', num2str(j), ' ', num2str(I(j))];
%disp(salida1);
%end
Salida2 =['Integral Total: ' , '', num2str(Int)] ;
fprintf(Salida2);
syms x;
ezplot(F);
grid on;
end