Four wines (two red and two whites) elaborated with the majority varieties in the Origin Denomination (O.D.) "Vinos de Madrid" were submitted to analysis by gas chromatography–mass spectrometry (GC–MS) to determine their content in volatile compounds of quality (alcohols, esters, acetates and acids) in three different moments: end of fermentation, after 2 months and before the clarification. The discriminant function analysis (DFA) applied to the data obtained by GC–MS shows that these compounds allow the classification of these wines in function of the variety of origin. These results agreed with those obtained with the sensor array used to classify the wines. Principal component analysis (PCA) and radial basis neural networks were used to check the classification performance of the sensor array.