correlation between binary strings
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi everyone I want to find the correlation between these two binary strings x and y
x=[1111111111111111111111111111111111111111111111111111111111111111];
y=[1000000001011001010110111110010101011010010000100010111101111110];
using the formula attached as figure. the value of E is 0.05 or 50%.
Thank you in advance
1 comentario
Respuestas (2)
Maria Imdad
el 9 de Abr. de 2021
Editada: Maria Imdad
el 9 de Abr. de 2021
2 comentarios
Walter Roberson
el 9 de Abr. de 2021
If the values are represented by 0 and 1, then it seems to me using 0.5 would make more sense...
Walter Roberson
el 9 de Abr. de 2021
R = sum((x - E).*(y - E)) ./ (sqrt(sum((x-E).^2)) .* sqrt(sum((y-E).^2)));
2 comentarios
Walter Roberson
el 9 de Abr. de 2021
It handles all of x and all of y, assuming that they are the same size. It uses vector operations so it does not need to loop. The sigma operation in the equation is sum() here.
Ver también
Categorías
Más información sobre Mathematics and Optimization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!