2014-02-10 45 views
1

我想用pdist2返回第二小值的索引,而不是值本身。因此,例如:使用pdist2()返回矩陣中第二小值的索引

% Compute the ordinary Euclidean distance 
X = randn(100, 5); 
Y = randn(25, 5); 
D = pdist2(X,Y,'euclidean', 'smallest', 2); % euclidean distance 

我將如何改變pdist2使D包含指數,而不是價值?

回答