I had the same problem. Well, I fixed it (around 1 month of constant work).
I am very athletic, so I cannot contribute to this problem to physical limits. I also have excellent morning erections, and sitting/laying down. I believe, as well, that my problem was caused from masterbating too much sitting down, and never standing up. I would stand up, and it would die.
Well, here was my training:
I would masterbate until very close to orgasm, and when I feel I'm a few seconds away, I would stand up and finish off standing up. This was to teach my brain to associate standing up as a good thing.
After a week or so of this (once or twice a day), I would stand up half a minute before orgasm, and finish off. Erection might get a bit weaker, but I'd keep going.
I gradually built up to being able to fully masterbate standing up. Now, I have ZERO problems. The trick is to SLOWLY get your brain accustomed to associating standing up to be something enjoyable and possitive, not negative. Hope that helped.