function area = mytrapz(x,y)
    [nx,mx] = size(x);
    [ny,my] = size(y);
    
    nx = max(nx,mx);
    ny = max(ny,my);
    
    if(nx ~= ny)
        area = 0;
        return;
    end
    n = nx;
    if(n <= 1)
        area = 0;
        return;
    end
    area = 0;
    for i = 2:n
        area = area + y(i)*(x(i)-x(i-1));
    end
end