distance metric Subscripted assignment error

2 vues (au cours des 30 derniers jours)
sm m
sm m le 11 Juil 2015
Modifié(e) : sm m le 11 Juil 2015
Hi
My test feature vector is 'testpg' and trained feature vector is 'trainpg' and both are of dimension 2000*1 .I am aiming to find the distance between the two histogram feature vectors and hence i do
distance = norm(trainpg-testpg)
Next I compare it to a scalar threshold value to check whether it satisfies my condition , The above code works well as i get a scalar value of this distance ie : for eg distance = 5.4 which is a scalar
But when I change code to use any other histogram based distance metric it doesn't work
The new code I used is
distance = pdist2(trainpg,testpg, 'chisq')
d = size(distance)
Here I am getting subscripted assignment dimension mismatch error as the dimensions of my distance are now 2000*2000 instead of 1*1
How could I get scalar value for the distances?

Réponses (0)

Catégories

En savoir plus sur Dimensionality Reduction and Feature Extraction dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by