Effacer les filtres
Effacer les filtres

Handle function in pdist2

1 vue (au cours des 30 derniers jours)
l.l.
l.l. le 20 Oct 2014
Commenté : Jan le 20 Oct 2014
I have a problem with an handle function used in pdist2 function. Distance function mydistance(l1, l2) wants l1 1xn and l2 1xn vector. So, I would like to use it for a matrix A mxn and to know all possible distances between different rows.
this syntax does not work:
weuc=@mydistance;
D=pdist2(A, A, @(Ai, Aj) weuc(Ai, Aj));
the result is:
Error evaluating distance function '@(Ai,Aj)weuc(Ai,Aj)'
How can I do?
  1 commentaire
Jan
Jan le 20 Oct 2014
Please copy the complete error message.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by