It is normal for a man to have five to six erections during sleep, especially during rapid eye movement (REM). Their absence may indicate a problem with nerve function or blood supply in the penis. There are two methods for measuring changes in penile rigidity and circumference during nocturnal erection: snap gauge and strain gauge. A significant proportion of men who have no sexual dysfunction nonetheless do not have regular nocturnal erections.
Associated morbidity may include various other male sexual dysfunctions, such as premature (early) ejaculation and male hypoactive sexual desire disorder. The NHSLS found that 28.5% of men aged 18-59 years reported premature ejaculation, and 15.8% lacked sexual interest during the past year. An additional 17% reported anxiety about sexual performance, and 8.1% had a lack of pleasure in sex. 
Counselling or sex therapy (58% of people find this works for them) –mind-related causes of erectile dysfunction can affect anyone. They are more likely if you experience erectile dysfunction at a younger age. Talking to a counsellor or therapist can help some people overcome erectile dysfunction related to these problems, possibly for good. They can also help you if your erectile dysfunction is causing you stress, as this can make matters worse.
Inside the cell, NOS catalyzes the oxidation of L-arginine to NO and L-citrulline. Endogenous blockers of this pathway have been identified. The gaseous NO that is produced acts as a neurotransmitter or paracrine messenger. Its biologic half-life is only 5 seconds. NO may act within the cell or diffuse and interact with nearby target cells. In the corpora cavernosa, NO activates guanylate cyclase, which in turn increases cyclic guanosine monophosphate (cGMP). Relaxation of vascular smooth muscles by cGMP leads to vasodilation and increased blood flow.
The vascular processes that produce an erection are controlled by the nervous system and certain prescription medications may have the side effect of interfering with necessary nerve signals. Among the possible culprits are a variety of stimulants, sedatives, diuretics, antihistamines, and drugs to treat high blood pressure, cancer, or depression. But never stop a medication unless your doctor tells you to. In addition, alcohol, tobacco, and illegal drugs, such as marijuana, may contribute to the dysfunction.
Conditions that may be associated with ED include diabetes, [25, 26, 27] hypertension,  , and CAD, as well as neurologic disorders, endocrinopathies, benign prostatic hyperplasia,  , sleep apnea  , COPD,  and depression (see Table 1 below). [32, 33, 34, 35] In fact, almost any disease may affect erectile function by altering the nervous, vascular, or hormonal systems. Various diseases may produce changes in the smooth muscle tissue of the corpora cavernosa or influence the patient’s psychological mood and behavior.