Learning grid-like units with vector representation of self-position and matrix representation of self-motion