Hello. If i have a 3×3, 5×5 or 7×7 matrix or generally a nxn matrix where n is odd, i want each element to represent the distance from the centre of the matrix. I.e the top left element in a 3×3 matrix to represent up one row and left 1 column. I.e (1,-1).
I then want to unravel this matrix into a 1D vector but in a serpentine fashion rather than raster scan
Best Answer