Hi, does anyone know how I can calculate the sum of all the relations between a matrix components? For example by having a 3*3 matrix like:
I want to calculate a relation between all the components such that:
r11=((a11-a12)/(a11+a12) + (a11-a13)/(a11+a13) + (a11-a21)/(a11+a12) + (a11-a22)/(a11+a22) + (a11-a23)/(a11+a23)+...
(a11-a31)/(a11+a31) + (a11-a32)/(a11+a32) + (a11-a33)/(a11+a33))/n;
I want to do this for every components of the matrix (each component has interaction with every other components) so that I have:
I used for loop but it takes a long time and long code to calculate the results (my real matrix is 101*101). Is there any simple way to do that? Thank you.