  Let $r$ and $n$ be positive integers such that $r<n$, and $\mathbb{K}$ be an
arbitrary field. We determine the maximal dimension for an affine subspace of
$n$ by $n$ symmetric (or alternating) matrices with entries in $\mathbb{K}$ and
with rank less than or equal to $r$. We also classify, up to congruence, the
subspaces of maximal dimension among them. This generalizes earlier results of
Meshulam, Loewy and Radwan that were previously known only for linear subspaces
over fields with large cardinality and characteristic different from $2$.
