Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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);

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by