Automatic mode selection in Mode-Matching analysis of waveg- guide structures