1. By 2005 amendments of Cr.P.C. the power has been conferred under Ss. 53 , 53A etc on the police to order medical examination. Thus, the old legal position does not hold good any more.
2.In your case, it is you who has filed a criminal complaint of defamation obviously under S. 500 of IPC. against your wife. So you have to prove that her allegation of impotemcy is false. Defamation is an example of private prosecution. You can get your self examined by an aurthorised doctor and obtain a certificate that your are not impotent and file it in the Court. Then, your wife has to rebut your evidence and she can do that by only asking for medical examination. So you will win wither way.