All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
Masturbation is a forbidden pernicious habit. The fact that your wife does not satisfy you sexually because she is too weak to have an intercourse is not an excuse to commit what is forbidden (masturbation). You can always resort to something permissible, like making your wife masturbate for you using her hand or to enjoy her body until you satisfy your sexual need.
For more benefit on the prohibition of masturbation, please refer to Fataawa 179859, 376036, 87952, 81167, and 88957.
Allah knows best.