将新的距离函数添加到matlab nctool

时间:2013-08-14 06:01:35

标签: matlab distance

如何在nctool中添加jaccard距离度量 我已将Jacdist.m文件添加到以下路径

MATLAB\R2008b\toolbox\nnet\nnet\nndistance

Jacdist.m源代码

function d = jacdist(pos)
%JACCARD Summary of this function goes here
%   Detailed explanation goes here
fn = mfilename;
if (nargin < 1), error('NNET:Arguments','Not enough arguments.'); end
if ischar(pos)
  switch(pos)
    case 'name'
      d = 'Jaccard Distance';
    otherwise, error('NNET:Arguments',['Unrecognized code: ''' pos ''''])
  end
  return
end

[dims,s] = size(pos);
d = zeros(s,s);
for i=1:s
  for j=1:(i-1)
    d(i,j) = pdist([pos(:,i) pos(:,j)],'jaccard');
  end
end
d = min(d(i,:));

然后在newsom.m中按以下路径添加新的距离函数名称

MATLAB\R2008b\toolbox\nnet\nnet\nnnetwork

但群集未正确执行

0 个答案:

没有答案