There seems to be a lot of good feedback on this thread. It's absolutely not something you should be embarrassed about, and I'm sure I'm not the only one who admires you for coming foraward.
This is a very appropriate, even if difficult thing to bring up with a professional health care provider. While I have healthcare experience in a field that can address similar concerns. I cannot offer you medical advice of any kind, of course.
Frankly, if it doesn't affect your ability to enjoy life in the manner you desire then it really doesn't matter and shouldn't get in the way of being the best, happiest, and healthiest you.
It could possibly indicate other underlying medical conditions about which you and your primary care doctor might be concerned, and is definitely worth mentioning to your doctor as a point of fact, and not necessarily as a problem to be solved. You're doctor might ask you questions about this. It may be hard not to feel shy or even just a little embarrassed with this. Remember, the physiological ability to function in that capacity is just that, strictly physiological. Physiology is the scope of your general practitioner's practice. You may or may not chose to explore possible physical causes through tests or assessments your doctor might suggest. In any case, this would be the first step, and in any case this could be a matter of physical health and your doctor should be aware of it.
If you rule out physiological causes with your doctor and choose to pursue futher assessment or treatment consider getting a referral from your doctor to an Occupational Therapist with experience in sex therapy (lol, no sex involved or expected). If your doctor can't recommend one, just get a general OT referral. Then call your state board of occupational therapy to see if there is an OT in your area who might be appropriate, or contact any OT on your insurance. If they can't help you they can find an OT who can. An OT can help you identify and overcome potential barriers including but not limited to physical difficulties to help allow you to meet personally meaningful goals regarding your ability to engage in personally meaningful sexual activity which can include areas like masturbation.
My background is in OT, so I've got a better idea of who does what within the medical system. Sexual is an area of practice within that field
Apart from that, this is also an appropriate subject to discusd with a psychiatrist, or therapist. In any case it's best to start with your doctor.
If anyone has any similar or more specific concerns regarding their ability to fulfill their expected sexual role. I can find an OT for you and get things started (I receive and expect nothing for this) I'd be very happy to PM, regarding any concerns like this, and do not discriminate.
Here's a helpful link from the American Occupational Therapy Association:
www.aota.org/About-Occupational-Therapy/Professionals/RDP/Sexuality.aspx