the following code is easier and faster:
Besides, you may use "meshgrid" command instead of defining x variable in your code (i.e. x=meshgrid(1:columns,1:rows);)
16 Feb 2012
Kullback-Leibler or Jensen-Shannon divergence between two distributions.