Column size mismatch error using pdist2

3 vues (au cours des 30 derniers jours)
Marlene Berke
Marlene Berke le 3 Avr 2016
Commenté : Marlene Berke le 3 Avr 2016
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');

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Avr 2016
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 commentaire
Marlene Berke
Marlene Berke le 3 Avr 2016
You're right, thanks!

Connectez-vous pour commenter.

Plus de réponses (1)

Roger Stafford
Roger Stafford le 3 Avr 2016
You have taken the transpose of 'condition1oder2' which gives it 36 columns. That's a no-no for 'pdist2'.

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by