Some research suggests that a vitamin B12 deficiency may cause erectile dysfunction in men. However, more research is needed to confirm the connection between B12 deficiencies and erectile dysfunction.
It's worth discussing your diet and potential vitamin deficiencies with your doctor. Other factors, such as smoking, alcohol use, lack of exercise, and stress can also play a role.