Hello all,
I'm throwing in the towel after struggling to come up with any elegant way to do a problem. I've uploaded the input and desired output as an image.
In words, basically I have 4qty 2×2 matrices that need to go into a bigger 5×5 matrix such that the overlapping elements are added. The bigger matrix size is a square matrix, always 1 plus the size of the smaller matrices. All the smaller matrices are the same size, in this case 2×2.
The issue is that the code needs to work for other cases too , in the sense that if I have 6qty of 2×2 matrices, the bigger 7×7 matrix also needs to have the sums of overlapping elements. So I'm looking for a general code.
Thanks really for helping!
Best Answer