Department of Electrical Engineering, Information Technology and Cybernetics
Introduction to Simulink
HANS-PETTER HALVORSEN, 2011.06.06
Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01
,Preface
Simulink, developed by The MathWorks, is a commercial tool for modeling, simulating and analyzing
dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set
of block libraries. It offers tight integration with the rest of the MATLAB environment and can either
drive MATLAB or be scripted from it. Simulink is widely used in control theory and digital signal
processing for simulation and design.
This training will give you the basic knowledge of Simulink and how you can use it together with
MATLAB.
For more information about MATLAB and Simulink, see my Blog: http://home.hit.no/~hansha
,Table of Contents
Preface..................................................................................................................................................... 2
Table of Contents ....................................................................................................................................iii
1 Introduction to Simulink ................................................................................................................. 1
2 Start using Simulink ........................................................................................................................ 2
2.1 Block Libraries.......................................................................................................................... 3
2.2 Create a new Model ................................................................................................................ 5
2.3 Wiring techniques ................................................................................................................... 6
2.4 Help window............................................................................................................................ 7
2.5 Configuration ........................................................................................................................... 9
2.6 Examples................................................................................................................................ 10
3 Useful Features ............................................................................................................................. 19
3.1 Comments/Labels.................................................................................................................. 19
3.2 Align and Distribute Blocks .................................................................................................... 19
3.3 Flip Blocks .............................................................................................................................. 20
3.4 Hide Names ........................................................................................................................... 21
4 Data-driven Modelling .................................................................................................................. 23
4.1 Command window ................................................................................................................ 23
4.2 m-file ..................................................................................................................................... 26
4.3 Simulation Commands .......................................................................................................... 27
5 Hybrid Systems (continuous and discrete) ................................................................................... 29
6 Example: Mass-Spring-Damper System ........................................................................................ 31
6.1 Model .................................................................................................................................... 31
6.2 Simulink ................................................................................................................................. 32
iii
, iv Table of Contents
6.3 m-File ..................................................................................................................................... 33
6.4 Results ................................................................................................................................... 33
7 Embedded Algorithms .................................................................................................................. 36
8 Subsystems ................................................................................................................................... 40
9 Model Explorer ............................................................................................................................. 44
10 Exercises ....................................................................................................................................... 45
Tutorial: Introduction to Simulink