Watch this Author's files
I am having the same problem as Gil Tidhar. When using the WAFO kde function, the minimum is 0 (which is what I expected), but your function returns negative values.
test code: >> [temp, pab] = kde2d(rand(10000, 2),... >> 2^4, [-3, -3], [5, 5]); >> min(min(pab)) returns -0.0026
Contact us at files@mathworks.com