SIMULINK
SIMULINK
Eraser 4
Pad 6
Tape 2
Calculate:
constant block is
highlighted as
shown
Similarly search
for other blocks
Model Window
Click to save
OUTPUT
Shopping Model
Suppose you purchased 4 erasers at 25 cents each,
6 memo pads at 52 cents each, 2 rolls of tape at 99
cents of each and you need to calculate,
Multiple-Line
After Changing the Names the Model will
appear as shown below
Connecting the Block
Click
Create Subsystem
Simulink Model Opens as Shown Below
with the Created Subsystem
Created Subsystem
To Edit a Subsystem
Select the Subsystem
Double Click
Subsystem
Subsystem appears as shown below
Eraser 4
Pad 6
Tape 2
Calculate:
Then choose
Create Subsystem
After creating the Subsystem the Model
appears as shown below
Masking the Block / Subsystem
Right click
The Subsystem Block
Choose
Mask Subsystem
Mask Editor opens as follows
Select Parameters
Now Mask Editor opens as follows
Click Here
Mask Editor opens as follows
Enter Comments
Here
Click Apply and OK
Now Simulink Model appears as shown
below
Enter
the
variable
name
Outport
Double click on the subsystem and the
Parameters Block opens as follows
Enter the Value
Click here to
Start Simulation
Display the Output
Result
Undo the Mask
Click Unmask
Then Click OK
Simulink Model appear as
shown below
Outport
Let us consider a Subsystem model for the equation y =
mx + c
The model is
Enter the
variable
names
Then choose
Create Subsystem
After creating the Subsystem the Model
appears as shown below
Masking the Block / Subsystem
Right click
The Subsystem Block
Choose
Mask Subsystem
Mask Editor opens as follows
Select Parameters
Now Mask Editor opens as follows
Click Here
Mask Editor opens as follows
Enter Command
Here
Click Apply and OK
Now Simulink Model appears as shown
below
Click here to
Start Simulation
Display the Output
Result
Undo the Mask
Click Unmask
Then Click OK
Simulink Model appear as
shown below
Unit Delay
The dialogue box opens as shown below
Click OK
Set the simulation time to 100
Select configuration
parameters
The configuration parameter dialogue box appear as
shown below
Set Simulation
Stop time to 100
Set Type to
Fixed-step
Set Solver to
Discrete
(no continuous states)
Click OK
Simulate the Model
Simulation time
Click here to
Start Simulation
z-1
ki
Sample time
it is a scalar interval between samples or a two-
element vector consisting of the interval between
samples and an offset or time skew.
Other Manipulations
Resizing a Block
Open a block library and
drag Gain block to the
model window.
We’ve set the block
parameter gain to the value
1227.86
Because this value will not
fit on the block icon
The displayed value is -K-
To resize a Block
Select the block,
causing the handles to
appear.
Click the desired
handle, and continue to
depress the mouse
button.
Drag the handle to resize the
block
Notice that the cursor changes
shape, confirming that you have
grasped the resize handle
Select a block,
Click Here
Then choose
Format : Rotate from
the menu bar.
The block will rotate
90 degrees
clockwise.
Shortcut key : ctrl r
Deleting Blocks
To delete a block, Select a Block and the
press the Delete key.
Alternative Method
Select the block, then choose Edit :Clear
from the menu bar.
Select the block and place it on the clip
board, then choose Edit :Cut or press
Control-X.
Changing Label Location
Select the block
Then choose Format :Flip
Name from the Menu bar Or
Click the name and drag it to
the desired position.
If the block is rotated 90° the
block label will be to the left
or the right of the block.
Hiding a Label
It is some times desirable to hide the
name of a block.
For example, the shape of a Gain
block uniquely identifies the purpose
of the block, and the value of gain
displayed on the block.
A cluttered model might be improved
by hiding the names of the gain
blocks.
To hide the name
Select the block, and choose
Format :Hide Name
This does not change the name of
the block in any way - It simply
makes the name invisible.
Select Hide Name
If the name of a block is hidden, to
show the name. Name
Select the block, then choose
Format :Show Name from the
Menu bar.
Adding a Drop Shadow
If you want to call special
attention to a block, you can
apply a drop shadow.
Select the block
Choose Format :Show Drop
Shadow from the menu bar.
Format :Hide Drop Shadow is
used to remove the drop
shadow from the block
Drop shadow
Using Colour
You can set the foreground and background
colour for each block or a selected set of
blocks.
Foreground colour is the colour of a block’s
outline and labels.
Background colour is the colour of the body of
the block.
To Change Colour of a Block
Choose Format:Foreground
Color or Format
:Background Color
Foreground color
Background color
To change screen colour
Screen color
SIGNAL LINES
Moving a Segment
To move a line
segment, click the
segment.
Line Segment
Vertex
The cursor will
change the shape
to circle.
Cursor Shape
Drag the vertex to the
desired location.
Dragging
Cursor Shape
Drag the new vertex
to the desired
location.
Dragging
Signal Line Label
Release the mouse
button. The label will
snap into position.
Moved
Signal Line Label
To copy a signal line
label press the control
key while dragging the
label to the new
position.
Copied
Signal Line Label
Signal Label Propagation
Signal line labels can propagate through several
blocks in the connections block library.
Among these are the Mux and Demux, Goto and
From, and Inport and Outport blocks.
Signal line propagation provides accurate means with
which to determine the exact content of a signal line.
This makes a model easier to understand and can
also be useful in debugging.
For example, a model in
which two scalar signals
produced by constant blocks
are combined to form vector
signal by a Mux block.
The Demux block splits the
vector signal into two scalar
signals that are displayed by
Display blocks.
propagated
Signal Line Label
ANNOTATIONS
You can add annotations to model to make it
easier to understand.
You can also change the font used in an
annotation to add emphasis
Adding Annotation
Editing Cursor
Double click the location where
you want the center of an
annotation to be.
An editing cursor will appear.
Enter the annotation. Press enter
at the end of each line of multiple-
line annotation.
Click away from the annotation to
complete the process.
Annotation
SIMULINK