We consider the ensemble controllability problem for a linear time-invariant system \(\dot{x}(t,\theta )=A(\theta )x(t,\theta )+B(\theta )u(t)\) , where A and B are continuous matrices with respect to the parameter \(\theta \) , which belongs to some compact set \(\Theta \subset \mathbb {R}\) . Given any continuous initial state datum \(\theta \mapsto x^0(\theta )\) and any continuous target state \(\theta \mapsto x^1(\theta )\) , we investigate the numerical computation of a \(\theta \) -independent open loop control u such that \(x^0\) is steered, in a given time \(T>0\) , at a distance \(\varepsilon >0\) of \(x^1\) in the uniform norm (with respect to the parameter). We approach the problem both theoretically and numerically. Using the Fenchel–Rockafellar duality, we first prove the existence and uniqueness of the ensemble control of a minimal \(L^2\) norm. The numerical recovery of the optimal control is obtained by solving the dual problem, which consists in the unconstrained minimization of a non-differentiable functional in the space of Radon measures.