sqeucldistm.m
来自「data description toolbox 1.6 单类分类器工具包」· M 代码 · 共 29 行
M
29 行
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, D.M.J.Tax@prtools.org% Faculty EWI, Delft University of Technology% P.O. Box 5031, 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';% no negative distances:D(D<0) = 0;return
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?