Variational analysis of determinantal varieties