Optimal Control of Aperiodic Discrete-Time Systems