% function [wert]=LobattoQuad(fhandle,n)
%
% Input:  fhandle - Funktion
%         n - Anzahl der Stützstellen
% Output: wert - Ergebniss der Quadraturformel
%

function [wert]=LobattoQuad(fhandle,m)

[d,n]=matrixLobatto(m);
[V,D]=jacobiEIGS(d,n);

%Knoten sind Eigenwerte
x=diag(D);

%Gewichte
for i=1:m
    w(i)=(2*(V(1,i)^2))/(norm(V(:,i),2))^2;
end

% Radau-Formel
f_x=feval(fhandle, x);
prod_vek=w.*f_x';

wert=sum(prod_vek);
