Hello, I understand your concern however I assure you that masturbation isn't related to your size of penis in any possible manner. A size of penis while resting varies individually and an erect penis of 4-5 inches is sufficient to make your partner conceive assuming you do not have any other health issues with related to sexual sphere.
Your doctor must have suggested you some procedure depending upon your examination findings, if you're still doubtful then you can surely get a second opinion from a sexologist or andrologist.
Hope this helps out and clear your query.
Please feel free to ask any other questions you've.