Usually, masturbation is used to gain the semen of the husband. If the semen can be gained by any other method apart from masturbation, like coitus interruptus, then masturbation will not remain permissible.
In coitus interruptus, the male sexual organ is withdrawn just prior to ejaculation. If it is possible to gain semen through this method, then there is no question at all of masturbation still being permissible.
However, if the husband is not able to perform intercourse, which makes using coitus interruptus impossible, then will masturbation be permissible in light of the Shariah?