Intramolecular circuits connected to N electrodes using a scattering matrix approach