I wanna know how should i write a function to generate correlation matrix without using functions like corr,corrcoef,corr2, etc.
i tried different way but didn't work,.
mj = mean(X(:,j));
mk = mean(X(:,k));
s(j,k)=1/19 * sum((X(:,j)-mj).*(X(:,k)-mk));
standard_dev1=sqrt(1/19 * sum((X(:,l)-ml).^2));
standard_dev2=sqrt(1/19 * sum((X(:,m)-mm).^2));
my dataset is a 20*7 matrix
main diameter of correlation must be 1.
I had trouble understanding the formula.