  Let $\cal M$ denote the set ${\cal S}_{n, q}$ of $n \times n$ symmetric
matrices with entries in ${\rm GF}(q)$ or the set ${\cal H}_{n, q^2}$ of $n
\times n$ Hermitian matrices whose elements are in ${\rm GF}(q^2)$. Then $\cal
M$ equipped with the rank distance $d_r$ is a metric space. We investigate
$d$-codes in $({\cal M}, d_r)$ and construct $d$-codes whose sizes are larger
than the corresponding additive bounds. In the Hermitian case, we show the
existence of an $n$-code of $\cal M$, $n$ even and $n/2$ odd, of size
$\left(3q^{n}-q^{n/2}\right)/2$, and of a $2$-code of size $q^6+
q(q-1)(q^4+q^2+1)/2$, for $n = 3$. In the symmetric case, if $n$ is odd or if
$n$ and $q$ are both even, we provide better upper bound on the size of a
$2$-code. In the case when $n = 3$ and $q>2$, a $2$-code of size $q^4+q^3+1$ is
exhibited. This provides the first infinite family of $2$-codes of symmetric
matrices whose size is larger than the largest possible additive $2$-code.
