I have for example two matrices in dimension of 1x5, and I want to reshape them to be in a symmetric 5x5 matrix after doing c = a+b
operation then adding the diag(c) <- 1
let's say for example:
a <- matrix(seq(1,5), byrow = T)
b <- matrix(seq(1,5), byrow = T)
the result I'm looking for is:
1 3 4 5 6
3 1 5 6 7
4 5 1 7 8
5 6 7 1 9
6 7 8 9 1
Please help, and thank you in advance