euclideandistance.m

来自「euclidean Distance」· M 代码 · 共 1,083 行 · 第 1/5 页

M
1,083
字号
% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------
function value = euclideanDistance(X, Y)

[r, c] = size(X);       % The length of the vector...

e = [];

% Euclidean Distance = sqrt [ (x1-y1)^2 + (x2-y2)^2 + (x3-y3)^2 ...]

for i = 1:c
    e(i) = (X(i)-Y(i))^2;
end

Euclid = sqrt(sum(e));

%Obtain energyLevel...
value = Euclid;


% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------

% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.
% ------------------------------------------------------------% Works to obtain the Euclidean Distance of the passed vector...

% ------------------------------------------------------------
% Executes on being called, with input vectors X and Y.

⌨️ 快捷键说明

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