Map muti-attribute arrays into matrices