There is an MPC Toolbox available through Mathworks. It is recommended if you are going perform many MPC simulations, especially if you are working with multivariable systems.
For those without the MPC Toolbox, simple m-files that can be modified for problems of interest are presented in Appendix 16.3. It is suggested that you download these files from the course web page and use them for Problems 1 and 2. For each new problem, simply insert the new continuous state space model at the appropriate location in the dmcsim.m file.