Match values of the standart with the sample. (pattern recogniton)

2 vues (au cours des 30 derniers jours)
Rafael Freire
Rafael Freire le 14 Sep 2011
I have those vectors above. A=sample, a,b,c=standart The value zero is when the sample don't have the variable an the value one is when the variable is present.
A=[0 0 0 0 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 1]
a=[0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1]
b=[0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
c=[1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0]
How can i correlate the values in a,b,c with the values in A. In other words, how can i find a,b,c in A and the percent o match? Expected results:
a=~~90% in A
b=100% in A
c= 0% in A
Best regards

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Sep 2011
100 * sum(a & A) / sum(a)

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by