How to mutate values of matrix which by mutating its sub-matrix?

Thanks for your feedback.