My problem is erection related

Patient: My question is related to sex..am male of 28 years ,and my problem is ; am not getting a lasting erection during intercourse ..with in minutes my erection get over ..and reaching climax it get non erectionel ….but doing masturbation it is erected…can you help whats my problem

Doctor: