  A lonesum matrix is a matrix that can be uniquely reconstructed from its row
and column sums. Kaneko defined the poly-Bernoulli numbers $B_m^{(n)}$ by a
generating function, and Brewbaker computed the number of binary lonesum
$m\times n$-matrices and showed that this number coincides with the
poly-Bernoulli number $B_m^{(-n)}$. We compute the number of $q$-ary lonesum
$m\times n$-matrices, and then provide generalized Kaneko's formulas by using
the generating function for the number of $q$-ary lonesum $m\times n$-matrices.
In addition, we define two types of $q$-ary lonesum matrices that are composed
of strong and weak lonesum matrices, and suggest further researches on lonesum
matrices. \
