How to get calculated ith element with its jith element (ij/sqrt(ii * jj) in matrix except diagonal

Viewed 16

I have a matrix (80rows, 80columns), i am trying to calculate product of each ith * jth elements and divided by sqrt of ii * jj elements, but diagonal element left alone. I am not getting any clue to provide an output.

a <- runif(100,0.0,1.0)
b <- matrix(a,10,10)
dput(b[1:5,1:5])
structure(c(0.232, 0.838, 0.488, 0.490, 0.799, 0.491, 0.424, 0.334, 0.399, 0.550, 0.835, 
0.784, 0.426, 0.643, 0.311,0.520, 0.670, 0.902, 0.992, 0.479, 0.737, 0.640, 0.547,0.011, 
0.166), dim = c(5L, 5L))

I Appreciate any help, thanks

0 Answers
Related