This work examines whether stepwise discriminant function analysis of a suite of craniodental variables enables feeding behaviour and habitat preferences to be identified in fossil ungulates. There are several morphological features of the ungulate skull, mandible and dentition that are well correlated with dietary adaptations, and thus can be used for estimating the feeding ecology of extinct taxa. However, most studies have followed an univariate approach for characterizing the relationship between diet and craniodental structure in extant ungulates (but see Pérez-Barberia & Gordon, 2001), even though such a relationship has been revealed to be complex because of functional, phylogenetic and biomechanical constraints. In this paper a multivariate perspective is followed, developing quadratic discriminant functions for pairwise comparisons of dietary/habitat groups in modern species. Given that the stepwise method for selecting the morphological variables to be included in the algorithms was used, alternative discriminant functions are provided. Results obtained show that these algorithms reclassify correctly the species according to their feeding and habitat ecology, and thus may be useful for obtaining reliable palaeoautecological inferences (i.e. those related to the life style of extinct species, such as feeding ecology and habitat preferences) when applied to extinct ungulate taxa.