MATLAB's custom distance function example for two matrices.
11 views (last 30 days)
How does MATLAB's @distfun work for two matrices. Suppose:
X1 = rand(5);
X2 = rand(3);
How to compute the KL-Divergence between X1 and X2 using @distfun? I do not see any non trivial distance example in manual. Please advise.
Viren Gupta on 7 Aug 2018
Here is a working example if you want to find KL divergence between 2 vectors.
function f = distfun(x1,x2)
Hope this helps.