Add generating ES matrix macros