Suppose we have a large A(n*n) and a small B(m*m) matrices (m<n). Also, there is a set J with the size of m which are values from {1,2,3,...,n}. I want to replace the matrix B in rows and columns of matrix A such that the first row (column) of matrix B is replaced in the first element of set J. For example,
[[1 1 1 1 1],
[1 1 1 1 1],
A = [1 1 1 1 1],
[1 1 1 1 1],
[1 1 1 1 1]]
and
J = [1, 3, 5]
B =[[2 3 4],
[5 6 7],
[8 9 10]]
Then, the result will be:
[[2 1 3 1 4],
[1 1 1 1 1],
A = [5 1 6 1 7],
[1 1 1 1 1],
[8 1 9 1 10]]