AnalogWrite custom voltage
The analog outputs aren't real analog outputs, they are PWM.

That means that they rapidly switch from OFF to ON and back to OFF again.  The analog value is the ration of OFF time to ON time, known as the Duty Cycle.

You can convert that rapid switching to a real voltage by passing the signal through a low pass filter.  The simplest form is the RC filter: