Column size mismatch error using pdist2
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm trying to calculate the distance between two matrices of size 36x16, but I get the error message "Error using pdist2 (line 133) X and Y must have the same number of columns." In the workspace, it says that both variables are 36x16 double. What's happening?
Dist11o=pdist2(condition1,condition1odor2');
댓글 수: 0
채택된 답변
Walter Roberson
2016년 4월 3일
Notice that after condition1odor2 you have a ' which is the transpose operator. You are asking it to transpose the 36 x 16 to 16 x 36
추가 답변 (1개)
Roger Stafford
2016년 4월 3일
You have taken the transpose of 'condition1oder2' which gives it 36 columns. That's a no-no for 'pdist2'.
댓글 수: 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!