Matrix multiplication in two files

I might be wrong , but since TMatrix inherits from TObject, you can write it to a TFile and retrieve it back.
Have you tried to write the object to a TFile and check you can get it back when reading the file?

import ROOT as r
fOut = r.TFile("test_save.root","RECREATE")
rows = 5
cols = 6
matrix = r.TMatrixD(5, 6)
matrix[0][1] = 1
matrix.Print()
fOut.WriteObject( matrix,"mymatrix")
fOut.Close()
fIn = r.TFile("test_save.root")
matrixRead = fIn.Get("mymatrix")
matrixRead.Print()
fIn.Close()

Tried on a notebook and there is no problem to write a matrix to a file and read it back