What is provided is a method and apparatus to modify sexual function by selectively electrically stimulating a mammalian nerve comprising: applying a dermal patch having an integral electrode in proximity to a sensory nerve associated with a penis or clitoris; determining one or more stimulations corresponding to the sensory nerve, by logic of the dermal patch; applying the stimulation by the electrodes and a stimulator integral to the dermal patch to produce an electric field; and selectively activating the sensory nerve by the electric field to produce an action potential in the sensory nerve that travels to a sacral segment of a spinal cord resulting in a reflex that modifies sexual function.