# correlation between binary strings

10 visualizzazioni (ultimi 30 giorni)
Maria Imdad il 9 Apr 2021
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%.
##### 1 CommentoMostra NessunoNascondi Nessuno
Walter Roberson il 9 Apr 2021
the value of E is 0.05 or 50%.
?? 0.05 would be 5% not 50% ?

Accedi per commentare.

### Risposte (2)

Maria Imdad il 9 Apr 2021
Modificato: Maria Imdad il 9 Apr 2021
0.05
##### 2 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Maria Imdad il 9 Apr 2021
yes exactly

Accedi per commentare.

Walter Roberson il 9 Apr 2021
R = sum((x - E).*(y - E)) ./ (sqrt(sum((x-E).^2)) .* sqrt(sum((y-E).^2)));
##### 2 CommentiMostra 1 commento meno recenteNascondi 1 commento meno recente
Walter Roberson il 9 Apr 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.

Accedi per commentare.

### Categorie

Scopri di più su Correlation and Convolution in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by