distances.m

来自「利用matlab实现彩色图像的分割。算法主要是利用聚类算法。」· M 代码 · 共 19 行

M
19
字号
function d = distances(v, m)%  DISTANCES Squared euclidean distances (works on vectors of any%  dimension)%% D is a vector containing the squared Euclidean distance of V from% each row of M.%% using repmat, takes 0.0013s%      v = v(:)';     % make into row vec    % get the current "pixel" ready for comparison to all groups  vm = repmat(v, length(m(:,1)), 1);       d = sum((vm - m).^2,2);  % sum of sq differences of each dimension         

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?