O'Reilly logo

Getting Started with Simulink by Luca Zamboni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Build the complete closed-loop system

So far we've got two models: a simple cruise controller and a beautiful car. Until now, they've been treated separately in an open loop. Remembering what we learned in the previous chapter, we're going to place the required blocks and connect them in a closed loop.

Let's open both the models and copy them to a new model named cruise_control_sim.slx. If their workspaces aren't loaded automatically, load them by dragging them from their folders to the MATLAB's Command Window and save the new workspace as cruise_control_sim.mat. It's suggested to have the new workspace loaded automatically via the PreLoadFcn model callback as we have learned in the previous chapter.

In order to see what's happening inside the engine, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required