MATLAB: Pdist custom distance function.

custom functionpdist

I have to use this distance in the pdist function:
norm((log(cov_1) - log(cov_2)),'fro')
I have already read the pdist documentation but I have not figured out how to define and call my distance in pdist.
someone could help, maybe with an example.

Best Answer

distfun = @(cov_1, cov_2) norm((log(cov_1) - log(cov_2)),'fro');
pdist(YourData, distfun)
Related Question