attach_all_matrices function

Attach all matrices in a batch simulation