Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Why we require Correlation


%Code:
clc
clear all
close all
x=[43 21 25 42 57 59];
a1=mean(x);
z=[];
for i=1:length(x)
    z=[z (x(i)-a1)^2];
end
s1=sum(z);
s1=s1/(length(x)-1);
s1=sqrt(s1);
y=[99 65 79 75 87 81];
a2=mean(y);
z=[];
for i=1:length(y)
    z=[z (y(i)-a2)^2];
end
s2=sum(z);
s2=s2/(length(x)-1);
s2=sqrt(s2);
x=x-a1;
y=y-a2;
ak=x*y';
cova1=ak/(length(x)-1);
corr1=cova1/(s1*s2);
x=2*[43 21 25 42 57 59];
a1=mean(x);
z=[];
for i=1:length(x)
    z=[z (x(i)-a1)^2];
end
s1=sum(z);
s1=s1/(length(x)-1);
s1=sqrt(s1);
y=2*[99 65 79 75 87 81];
a2=mean(y);
z=[];
for i=1:length(y)
    z=[z (y(i)-a2)^2];
end
s2=sum(z);
s2=s2/(length(x)-1);
s2=sqrt(s2);
x=x-a1;
y=y-a2;
ak=x*y';
cova2=ak/(length(x)-1);
corr2=cova2/(s1*s2);


No comments

Popular Posts

Followers