function res=trapz2d(x,y,F)
% 2 dimensionsiol trapezoid integration
[nx,ny]=size(F);
if ny~=length(y)
    F=F';
end    
res=trapz(y,trapz(x,F));

%for i=1:length(x)
%    X(i)=trapz(y,F(i,:));
%end
%res=trapz(x,X);