update read a matrix from file