Series and parallel addition of matrices