
clc
clear all

panel = 12;
nokta = 2 * panel + 1;

a = 8;
b = 30;
h = (b - a) / (nokta - 1);

t = a:h:b;
f = soru1f(t);

I = (h / 3) * (f(1) + 4 * sum(f(2:2:nokta - 1)) + ...
    2 * sum(f(3:2:nokta - 2)) + f(nokta));

Q = quad(@soru1f, a, b);

hata = abs(Q - I);

fprintf('hesaplanan: %f\ngercek deger: %f\nhata: %f\n', I, Q, hata);
