Gabidulin codes.

The geometric counterparts of $h$-scattered subspaces of dimension $\frac{rn}{h+1}$ are called *$h$-scattered linear sets* of rank $\frac{rn}{h+1}$. They are known to have at most $h+1$ intersection numbers with respect to the hyperplanes, and hence are of interest in coding theory when regarded as projective systems. The intersection numbers w.r.t. the hyperplanes of $h$-scattered linear sets of rank $\frac{rn}{h+1}$ have been determined in [@BL2000] for $h=1$, in [@NZ] for $h=2$, and in [@ShVdV] for $h=r-1$. We determine them for any $1\leq h\leq r-1$, by using the connection between MRD codes and $h$-scattered subspaces of dimension $\frac{rn}{h+1}$ presented in Section \[sec:subMRD\]. As a byproduct, we compute the weight distribution of the arising codes; this answers a question posed by Randrianarisoa [@Ra].

The paper is organized as follows. Section \[sec:pre\] contains preliminary results on $h$-scattered subspaces (Section \[sec:h-scatt\]), dualities of subspaces, both ordinary and Delsarte (Section \[sec:dualities\]), linear codes, equipped with the Hamming distance or with the rank metric (Section \[sec:codes\]). In Section \[sec:subMRD\] we describe the connection between ${{\mathbb F}_{q}}$-subspaces and rank metric codes, characterizing those codes which are MRD, and showing that ${{\mathbb F}_{q}}$-linear MRD $(\frac{rn}{h+1},n,q;n-h)$-codes with maximum right idealiser are exactly the codes of type $\mathcal{C}_U$, up to 