What is the best way to add a series of smaller matrices to a particular point of a bigger matrix?
For example:
Starting with an empty matrix of zeros:
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
I would like to insert the following matrices into the larger matrix, and add elements where the matrices overlap
Small 1:
1 1
1 1
Small 2:
2 2
2 2
Small 3:
3 3
3 3
Such that the final result looks like this:
1 1 0 0
1 3 2 0
0 2 5 3
0 0 3 3
Any help would be appreciated.