Products of similar matrices