Thank you for your question on ehealthforum.com
Masturbation does not affect your sexual potency. It is not detrimental to your sexual health. It is normal to find a difficulty in getting an erection from time to time especially in young people and in most cases no abnormal pathological cause is found. It could be due to stress or related issues. If your general health is good, libido is normal and you were getting erections regularly before and getting gratification from both masturbation and intercourse, then most probably, this is a temporary and more likely to become normal
However, if it gets persistent, a consultation with your doctor for a precautionary examination may be warranted. Thank you.