I have some equations of motion that I want to integrate using an ODE solver. I also have a control input to these equations of motion that I want to implement as a zero-order hold input. The control input is a continuous function of states. The way I am currently doing this is by having my ODE solver (currently it is ode113) inside a for loop that iterates over the time intervals that I want the control input to be constant over. Other than specifying the initial step size for ode113, are there any other things I can do to make this integration more efficient? Or are there any alternative ways I should go about this? Any advice is greatly appreciated.