I have a matrix H, which for arguments sake is of size 6-by-6.
I need to sum three things, first I need h_ii, then I need to sum all the other elements which contain element i, apart from h_ii. Then I need all the other that do not contain j.
To visualise this, have created the following diagram,
So from the diagram,
For each diagonal of the matrix, h11, h22, ... , h66.
I need to sum the orange (cells that contain all the ij cells), and then the yellow, (the cells that do not contain i, the jj cells).
I have tried to sum the individual columns and rows but this becomes very messy.
Ideally, I need to give the matrix, and it produces h11 = X, h11_orange = Y, and h11_yellow = Z.
