Allocate matrices on the stack