This isn’t all that surprising. When you feel blue and low on energy, it can be extremely difficult to perform at your sexual peak. Furthermore, depression is linked to changes in your brain chemistry and nervous system. Some of these areas also affect your sex drive and ability to have an erection. This means that depression can change the way your brain works, making ED more likely.
Erectile problems can happen to men of any age. There are many factors that contribute to ED including poor health, untreated medical problems, medications and pornography use. Many men struggle with understanding when they are experiencing situational sexual dysfunction verses when is your erectile issue an ongoing problem that requires medical help.
There are many different treatment options for erectile dysfunction but your individual diagnosis will determine which treatment option is right for you. It is important to realize that not all treatment options will work for everyone. A doctor who has specialized in men’s sexual health (typically a urologist) will be the most qualified to discuss all of your treatment options with you. Many specialists will often encourage you to schedule additional follow up appointments to review how your treatment is working for you or if a different option may be more beneficial.
Recently, several advances in the uses of stem cells have bet met with great anticipation. Stem cells have the ability to differentiate into different cell lines based on the cellular signaling they receive. Bone marrow mononuclear cells in particular have been used for the treatment of ED in animal models. Yiou et al. recently delivered bone marrow-mononuclear cells (BM-MNC) into the intracavernous smooth muscle of post radical prostatectomy men (123). The open label, dose escalation phase I/II trial showed improvements in IIEF-15 assessment as well as increased vascularization of the corpora based on penile Doppler arterial velocity measurements. Although promising, further investigation in humans is required to substantiate BM-MNCs impact on erections, and erectile function recovery going forward.
Erections occur in response to tactile, olfactory, and visual stimuli. The ability to achieve and maintain a full erection depends not only on the penile portion of the process but also on the status of the peripheral nerves, the integrity of the vascular supply, and biochemical events within the corpora. The autonomic nervous system is involved in erection, orgasm, and tumescence. The parasympathetic nervous system is primarily involved in sustaining and maintaining an erection, which is derived from S2-S4 nerve roots.
Hormone deficiency or hypogonadism, whether primary or secondary, has been thought to impact erectile function. Approximately a third of men in the European Male Aging Study demonstrated low testosterone, suggesting that hypogonadism is overrepresented among men with ED.11 Hormone deficiency, however, is less frequently the cause of ED than diabetes or vascular disease. Many entities with a strong relationship to ED also diminish bioavailable testosterone, including obesity, diabetes, and opioid use. Other hormones involved in testosterone metabolism or availability, like thyroid stimulating hormone and gonadotropins, also may impact erectile quality, presumably through regulating bioavailable testosterone. Understanding the relationship between testosterone and ED has been impaired by a lack of standardized measurement of this hormone and the cyclic nature of its release and consumption.
Both ED and low testosterone (hypogonadism) increase with age. The incidence of the latter is 40% in men aged 45 years and older.  Testosterone is known to be important in mood, cognition, vitality, bone health, and muscle and fat composition. It also plays a key role in sexual dysfunction (eg, low libido, poor erection quality, ejaculatory or orgasmic dysfunction, reduced spontaneous erections, or reduced sexual activity). 
Cavallini, G., Modenini, F., Vitali, G., & Koverech, A. (2005, November). Acetyl-L-carnitine plus propionyl-L-carnitine improve efficacy of sildenafil in treatment of erectile dysfunction after bilateral nerve-sparing radical retropubic prostatectomy. Urology, 66(5), 1080-5. Retrieved from http://www.sciencedirect.com/science/article/pii/S0090429505006515
For best results, men with ED take these pills about an hour or two before having sex. The drugs require normal nerve function to the penis. PDE5 inhibitors improve on normal erectile responses helping blood flow into the penis. Use these drugs as directed. About 7 out of 10 men do well and have better erections. Response rates are lower for Diabetics and cancer patients.