Model predictive control is an optimal control method that requires the solution of a quadratic programming problem with constraints at each sampling time. In this study, an active set method is used to solve the problem. The whole control algorithm is written through Matlab editor so that it can be run in embedded systems. A ball and beam system model is utilized to investigate the performance of the controller structure. The simulations are conducted with two different cost functions. The results illustrate that the constructed control system exhibits satisfactory performance in the sense of system response and constraints.