MATLAB Answers

following is the error while calculating euclidean distance using pdist2, what should i do ..

6 views (last 30 days)
testdata =
3×1 cell array
[54×6 double]
[44×6 double]
[44×6 double]
>> traindata
traindata =
8×1 cell array
[50×6 double]
[47×6 double]
[38×6 double]
[31×6 double]
[43×6 double]
>> pdist2(testdata,traindata); Warning: Converting input data to double. > In pdist2 (line 232) Error using cast Conversion to double from cell is not possible.
Error in pdist2 (line 234) X = cast(X,outClass);


Sign in to comment.

Accepted Answer

KSSV on 28 Feb 2018
You need to convert your cells into matrix and then call _pdist2).
testdata = cell2mat(testdata) ;
traindata = cell2mat(traindata) ;


Show 3 older comments
Balaji M. Sontakke
Balaji M. Sontakke on 2 Mar 2018
Sir, actually the block[50 X 6] contains 'minutiae' information which contains the following data in columns [X, Y, CN, Theta, Flag, 1]and rows contains number of minutiae information on the dorsalhandvein. if i go like this the matrix size increase, so I want to reduce minutiae information which is in row. sir is there any function to reduce row size.

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!