I am due to see a gynaecologist next week. What is really worrying me is this: when she examines me, will she be able to tell I have masturbated?

No, she won't be able to detect this. Furthermore, I can assure you she couldn't care less.