Objective. To explore the effect of continuous psychological nursing based on the grey clustering algorithm on erectile function, bad psychological emotion, and complications in patients after transurethral resection of prostate (TURP). Methods. 98 patients who underwent TURP were randomly divided into observation and control groups (routine nursing). The observation group first used the grey clustering algorithm to evaluate the psychological intelligence, found patients with abnormal psychological behavior, and then implemented continuous psychological nursing combined with pelvic floor muscle exercise. The patients were followed up for 4 months. The International Index of Erectile Function-5 (IIEF-5), the incidence of complications, the Hamilton Depression Scale (HAMD), the Hamilton Anxiety Scale (HAMA) scores, and the nursing satisfaction were analyzed and compared between these two groups. Results. The grey clustering algorithm can accurately reflect the characteristics of patients’ psychological changes. After targeted nursing, compared with the control group, the IIEF-5 in the observation group was higher [(
24.87
±
1.85
) vs. (
22.24
±
1.47
),
P
<
0.05
], the incidence of total complications was lower (10.20% vs. 26.53%,
P
<
0.05
), the score of HAMA was lower [(
6.11
±
2.57
) vs. (
10.98
±
2.29
),
P
<
0.05
], the score of HAMD was lower [(
6.97
±
2.85
) vs. (
11.35
±
2.19
),
P
<
0.05
], and the nursing satisfaction was higher (100% vs. 85.71%,
P
<
0.05
). Conclusion. Mental intelligence evaluation based on the grey clustering algorithm combined with pelvic floor muscle exercise can significantly improve the rehabilitation effect of erectile function in patients after TURP, reduce the incidence of postoperative complications, and alleviate patients’ anxiety and depression.