Create average matrix