Let $E$ be a finite set and $\mathcal P$, $\mathcal S$, $\mathcal L$ three classes of subsets of $E$, and $r$ a function defined on $2^E$. In this paper, we give an algorithm for testing if the quadruple $(\mathcal P, \mathcal S, \mathcal L, r)$ is the locked structure of a given matroid, i.e., recognizing if $(\mathcal P, \mathcal S, \mathcal L, r)$ defines a matroid. This problem is intractab...