The first question you have to answer is if YALMIP is the right tool. Why not a tool for developed for optimal control instead (gpops, adaco comes to mind)
You basically have to have code which computes jacobians (linearizations) at a given state xk (and input uk). x(k+1) ~= f0 + A*(x(k)-xk) + B(u(k)-uk). From this, you setup a standard MPC problem. You can setup an optimizer problem parameterized in f0, A and B if you want, thus making it possible to get rid of almost all overhead. A generalized version where you parameterize f0/A/B-matrices along the whole future trajectory is also possible. The main computational effort will most likely be to compute the future state (integrate the differential equation) and matrices A and B, at least that was what I saw when I played with this as a small demo of optimizer. Various hacks (compared to using developed optimal control packages) would be to iterate at each time, linearizing and optimizing new trajectories iteratively.
ode45 doesn't discretize any model, it computes the solution to a differential equation, i.e., it gives you the states given inputs and initial state