PATTERN_EUCLIDEAN_CVIP

pattern_euclidean_cvip() - takes two csv files as input, test and training set, then calculates the Euclidean distance metric by comparing each vector in the test set to each in the training set

Contents

SYNTAX

d = pattern_euclidean_cvip(file_tt, file_tr)

Input Parameters include :

Output Parameters include :

DESCRIPTION

Using euclidean metric, the function calculates the distance between the vectors in training set and the test set. The distances are returned in a matrix form whose rows represent the test vectors and columns represent the training vectors.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Test set file

 file_tt = 'myTestVectors.CSV';

% Training set file

 file_tr = 'myTrainingVectors.CSV';

% Calling function

 d = pattern_euclidean_cvip(file_tt, file_tr)
d =

   25.0000   20.3961   22.4722   18.3576   12.0830   12.0416   12.0416
   27.2947   25.4951   29.0000   15.5242   12.8062   16.2788   16.2788
   21.3776   17.8885   20.8087   13.0000    7.0711    8.5440    8.5440
   28.1780   26.2488   29.6985   16.4924   13.6015   16.9706   16.9706
   20.6155   17.4929   20.6155   11.7047    6.0000    8.0623    8.0623
   23.0217   18.6815   21.0238   16.1245    9.8489   10.0000   10.0000
         0    6.4031    8.9443   12.7279   14.8661   13.0384   13.0384
    6.4031         0    4.1231   13.6015   12.7279    9.4340    9.4340
    8.9443    4.1231         0   17.7200   16.4012   12.7279   12.7279
   12.7279   13.6015   17.7200         0    6.4031    8.9443    8.9443
   14.8661   12.7279   16.4012    6.4031         0    4.1231    4.1231
   13.0384    9.4340   12.7279    8.9443    4.1231         0         0

CREDITS

Author: Mehrdad Alvandipour, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website

%c