First of all, please don't think you are a weak person because of ED. That won't help you at all. I know it's tough, but writing yourself off like that will only plunge you further into depression/anxiety and even other problems like ED.
Yes, I think depression/anxiety could contribute to ED. When you are severely depressed or anxious your body and mind often don't function the way they should.
Sexual desire comes from the brain and if you are caught up with other troubles then you won't be willing or able to be sexual.
Also, are you on meds for your conditions? I remember the weirdest and most distressing thing was the total loss of libido and erection when I took Anti-depressants for a very short period of time about 7 years ago.
Please don't give up. Try some of the things mentioned in the other threads and report back. Good luck.