For example, say ball 7 is heavier. From top to bottom, the weightings would result in: 120. However, if ball 19 was lighter you would obtain the same weighing sequence 120.
I believe that there is another condition that must be imposed on the matrix - namely, the column must be unique, but also -1*column must not be another column.
I created the following matrix, which can identify the ball and if it is heavier or lighter. However, this does not line up neatly, and would require a table to decode the output of the weighings.
-1 -1 -1 -1 1 1 1 1 0 0 0 0 -1 -1 0 1 0 -1 -1 0 1 1 0 1 0 1 -1 0 -1 1 -1 0 1 0 1 -1
For example, the sequence 001 means the first ball is heavier. The sequence 221 means the first ball is lighter. Etc.