sqeucldistm.m

来自「数据挖掘的工具箱,最新版的,希望对做这方面研究的人有用」· M 代码 · 共 28 行

M
28
字号
function D = sqeucldistm(A,B)%SQEUCLDISTM Square Euclidean distance matrix%%        D = SQEUCLDISTM(A,B)%% A specialized function for computing the squared Euclidean% distance D between datasets A and B. This is mainly for% computational speed, so it is light-weight, without any checking.% Normal users will probably use myproxm.%% Mainly for internal use.%% see also: myproxm% Copyright: D.M.J. Tax, davidt@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsnra = size(A,1);nrb = size(B,1);dA = sum(A.*A,2);dB = sum(B.*B,2);D = repmat(dA,1,nrb) + repmat(dB',nra,1) -2*A*B';D(D<0) = 0;return

⌨️ 快捷键说明

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