We used three classification algorithms to classify the middle-aged and elderly EEG, and the extracted features were used as input for these classifiers. KNN achieved its highest accuracy in the resting state (eyes open and eye closed) and during the WM task to classify the EEG signals obtained from middle-aged and elderly groups. KNN achieved 87.80% accuracy for K = 3 with a Euclidean distance measure in an eyes-open state, 93.33% accuracy with K = 3 in an eyes-closed state, and 98.89% accuracy for K = 5 in the WM task, as shown in Table 1, Table 2 and Table 3. The value of K in KNN was evaluated for 1, 3, and 5. In an eyes-open state for K = 1 85.50%, K = 5 achieved 76.66% accuracy. In an eyes-closed state, we achieved an accuracy of 91.11% with K = 1 and achieved 87.77% accuracy for K = 5. In the visual WM task, classification accuracies of 94.40% and 97.78% were obtained for K = 1 and K = 3, respectively.