There aren't many things in the world funnier than a sporty car. That's a fact.
Let's imagine we want to develop a simple cruise control system for such a car. This system will perform the following tasks:
Read the target vehicle speed [km/h]
Read the current vehicle speed [km/h]
Command the throttle with the gas pedal [from 0 (not pressed) to 1 (fully pressed)]
This system will behave like a driver that keeps the car going straight using only the gas pedal to match the desired speed.
Let's get started!
After pointing MATLAB to your preferred working folder (for example, a folder called 1386EN_02
located in your home folder) and opening a new model, click on the Save button, or use the Save option under the File menu, or the Ctrl + S keyboard shortcut, and give it the name cruise_control.slx
.
You'll notice that there are two file formats available. They are explained as follows: