Why complicate it with a matrix? Just use 9 IO pins. Or maybe 3 pins for a shift register and 1 more pin.