mydistf.m
来自「神经网络学习过程的实例程序」· M 代码 · 共 31 行
M
31 行
function d = mydistf(pos)
%MYDISTF Example custom distance function.
%
% Use this function as a template to write your own function.
%
% Syntax
%
% d = mydistf(pos)
% pos - NxS matrix of S neuron position vectors.
% d - SxS matrix of neuron distances.
%
% Example
%
% pos = gridtop(3,2);
% d = mydistf(pos)
% Copyright 1997 The MathWorks, Inc.
% $Revision: 1.3.2.1 $
s = size(pos,2);
for i=1:s
for j=1:s
% ** Replace the following line of code with your own
% ** measure of distance.
d(i,j) = norm(pos(:,i)-pos(:,j),1.5);
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?