This research explores the relationship between emotions and understanding in mathematics. In concrete, an interpretive model is proposed allowing to relate, operationally, the student's emotional experience with a functional view of their understanding, based on their uses of mathematical knowledge. The model includes a specific method for detecting the connections between students’ emotions and their understanding during mathematical practices in the classroom. This method is applied in an empirical qualitative study with preservice elementary teachers involved in measurement problem solving in pairs. The study provides positive results on the influence of students' understanding on the generation of their different emotions during the mathematical activity performed. In the same way, the emotions provide plausible reasons that help to explain the students’ mathematical understanding.