Biomedical Engineering Reference
In-Depth Information
y 1
+
ÿ 1
y 1
1
3
f (t)
Σ
dt
dt
10
60
5
y 2
ÿ 2
y 2
1
4
Σ
dt
dt
5
40
5
A.4 SIMULINK
SIMULINK is a toolbox in MATLAB that simulates linear and nonlinear continuous and
discrete dynamic systems. We program a system from the block diagram as described in the
previous section using SIMULINK by dragging and dropping blocks and connecting the
blocks together according to the system equation or equations. After building the model
we run the program to plot results or export the results to MATLAB.
To start SIMULINK, start MATLAB as before, then type “simulink” in lowercase letters in
the command window. This brings us to another window containing the icons for imple-
menting a SIMULINK simulation as shown in Figure A.8. Next, select “File” on the menu
bar, then “New” and “Model”. This brings up another window, a workspace, that is used
to create the SIMULINK model as shown in Figure A.9. The icons shown make up the basic
subsystem of blocks used to create a simulation, with each providing a set of blocks arranged
into libraries. The libraries are a collection of blocks grouped into similar functions.
Double-clicking on any of the icons opens up the library of blocks. For example, double-
clicking on the “Math Operations” library opens the window shown in Figure A.10 with
common operations such as absolute value (Abs), gain, math function, etc. The library
“Continuous” contains the blocks for the derivative and integrator among other blocks.
The library “Sources” contains the blocks for a constant, clock, step, etc., all blocks that pro-
duce an output without an input. The block “clock” outputs the current simulation time as
a variable, useful in decision blocks and outputting variables to MATLAB. The library
“Sinks” contains the blocks associated that have an input but no output, such as the scope
that displays a variable as a function of time as if on an oscilloscope. Another important
block in this library is the block “To Workspace”, which allows exporting a variable to
MATAB for further analysis and plotting.
Blocks are copied from the “SIMULINK Library Browser” window to the workspace
window in Figure A.9 by simply dragging them across from one to the other. Each block
Search WWH ::




Custom Search