Basic Simulink Tutorial 012005
Basic Simulink Tutorial 012005
OVERVIEW
Simulink is a powerful system modeling tool which is included with the MATLAB software
package. It allows the user to graphically model equations and analyze the results, so that
systems can be better understood and "what-if" scenarios can be more readily explored. This
particular tutorial is designed to familiarize the student with the basic tools needed to develop
and run a Simulink model. Once these basic concepts are understood, the student will be
prepared for other tutorials in this series which specifically address the issues of modeling
dynamic systems. Students who are already familiar with the basics of Simulink may wish to
jump directly to the other tutorials.
TUTORIAL CONVENTIONS
The following conventions will be used in this tutorial and the others in this series to
facilitate an understanding of the command sequences:
Note: The input boxes within parameter windows always require numerical input. For this
tutorial however, you may see variables in these input boxes to aid in understanding what values
are being entered. You must input the numerical value associated with that variable for your
model to run properly.
GETTING STARTED
Double click on the MATLAB icon on your desktop. The command prompt window will
appear as in Fig. 1.
To build a model, drag and drop blocks from the library into the model space. For example,
to drag a Scope block into the model space, click on the Simulink library browser tree, then click
on the Sinks submenu. A series of icons will appear on the right, each indicating a particular
block type. Now click and drag the Scope icon onto the model space. Refer to Fig. 3 below.
Lines are used to connect blocks, allowing "signal transmission" between blocks.
Drag and drop a Sine Wave block from the Sources submenu into the model space. Notice
the output of the Sine block (the “greater-than” symbol on the right side) and the input of the
Scope block (the “greater-than” symbol on the left side) in Fig. 4 below.
You can also create a branch line off an existing signal line. To do this, press and hold the
Ctrl key, position the curser on the line where the branch is to be created, then left-click and
draw the branch line as in Fig. 7.
Sometimes it will become necessary to rotate a block. This can be done easily by right-
clicking on the block, selecting Format → Flip Block or Rotate Block. The results of these
choices can be seen in Fig. 8 below.
To create additional instances of a block, simply hold down the Ctrl key, click on the block,
and drag off a copy. To move a block, simply left-click on the block and drag the block to a new
location.
To change block labels, simply click on the label and edit. To add a text box to the
workspace, double-click anywhere on the workspace and a textbox will appear. Type into the
textbox as usual; when done, click anywhere outside the textbox.
Block parameters are used to control block input and output. The parameter window for any
block can be viewed by double-clicking on the block. For example, double-clicking on a Sum
block, examples of which are shown in Fig. 9, will open the “Block Parameters: Sum” window
shown in Fig. 10 below.
Once the block parameters have been specified, it is time to run the model simulation. Select
Simulation from the menu bar, then Simulation Parameters. The window shown in Fig. 11 will
appear.
To view the output of any block, simply drag and drop a scope block into the model space (as
shown in Fig. 3) and tap off of the line of interest. After running the simulation, the results can
be viewed by double-clicking on the Scope block. A window like that in Fig. 13 will appear.