Dynamically regulate voltage
Output voltage and voltage regulating are two different things. The second should be done by the regulator.

This is how you can achieve the first if you're using a LM317:

With digital outputs:



And the potentiometer variant: