  MRD codes are maximum codes in the rank-distance metric space on $m$-by-$n$
matrices over the finite field of order $q$. They are diameter perfect and have
the cardinality $q^{m(n-d+1)}$ if $m\ge n$. We define switching in MRD codes as
replacing special MRD subcodes by other subcodes with the same parameters. We
consider constructions of MRD codes admitting such switching, including
punctured twisted Gabidulin codes and direct-product codes. Using switching, we
construct a huge class of MRD codes whose cardinality grows doubly
exponentially in $m$ if the other parameters ($n$, $q$, the code distance) are
fixed. Moreover, we construct MRD codes with different affine ranks and
aperiodic MRD codes.
  Keywords: MRD codes, rank distance, bilinear forms graph, switching, diameter
perfect codes
