following is the error while calculating euclidean distance using pdist2, what should i do ..
조회 수: 2 (최근 30일)
이전 댓글 표시
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);
댓글 수: 0
채택된 답변
KSSV
2018년 2월 28일
You need to convert your cells into matrix and then call _pdist2).
testdata = cell2mat(testdata) ;
traindata = cell2mat(traindata) ;
pdist2(testdata,traindata);
댓글 수: 6
Walter Roberson
2018년 3월 2일
reduced_testdata = cellfun(@(M) M(1:min(end,20), :), testdata, 'uniform', 0);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!