add matrix head file