Optimal Control Of Switched-Input And Uncertain Systems