You are on page 1of 39

INDEX

Date of
Sl No Session Content Page No Remarks
Performances
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Basic of MATLAB
MATLAB is a software package for high performance numerical computation and visualization. Using
MATLAB, you can analyze data, develop algorithms, and create models and applications.
 MATLAB stand for MATRIX LABORATORY, because in MATLAB environment all the
inputs are taken in terms of matrix.
 A matrix can be entered to MATLAB with in a square bracket.
 For a matrix with more than one row, then it need to put a semicolon (;) after elements of each
row.

 A colon specifies all the elements between a range.


 Syntax – se : in : fe
se-start element, in- increment , fe-final element
 If no increment has been specify the by default the increment taken to be 1.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

 Elements can be access by its index,


 Syntax- The format for accessing elements is a (r, c)
 r=row index, c=column index
 The digit before comma (,) represent row index and digit after comma represents column index
 To access more than one element we need the help of colon operator (:)
Example

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Special matrix

 zeros(m,n) = create zeros matrix of size (m x n)


 ones(m,n) = create one matrix of size (m x n)
 zeros(n) = create zeros matrix of size (n x n)
 ones(n) = create one matrix of size (n x n)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Loops and Control Flow


MATLAB has its control flow such as for loop, while loop and if-elseif branching.
It also provide three commands-break, error and return to control the execution of script and function.
For loop
A for loop used to repeat a statement or a group of statements for a fixed number of times.

PROGRAM-1

clc;
clear all;
close all;
a=zeros(5,5);
for i=1:5
for j=1:i
a(i,j)=j;
end
end
disp('The pattern is as below :');
disp(a);

PROGRAM-2

clc;
clear all;
close all;
a=zeros(5,5);
for i=1:5
for j=6-i:5
a(i,j)=i+j-5;
end
end
disp('The pattern is as below :');
disp(a);

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

PROGRAM-3

clc;
clear all;
close all;
a=char(32*zeros(5,5));
for i=1:5
for j=1:i
a(i,j)=char(48+j);
end
end
disp('The pattern is as below :');
disp(a);

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Menu
The command menu( 'MenuName', 'optionl', 'option2',.. .) creates an on-screen menu with the
MenuName and lists the options in the menu. The user can select any of the options using the mouse or
the keyboard, depending on the computer. The implementation of this command on Macs and PCs
creates a nice window menu with buttons.
PROGRAM

clc;
clear all;
close all;
var=menu('CALCULATOR','ACQ','ADD','SUB','MUL');
% var=calculator('acq','add','sub','mul');
if var==1
x=input('enter 1st no.');
y=input('enter 2nd no.');
end
if var==2
x=input('enter 1st no.');
y=input('enter 2nd no.');
z=x+y;
disp(z);
end
if var==3
x=input('enter 1st no.');
y=input('enter 2nd no.');
w=x-y;
disp(w);
end
if var==4
x=input('enter 1st no.');
y=input('enter 2nd no.');
s=x*y;
disp(s);
end

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Plotting Simple Graphs


The plots in MATLAB appear in graphics window also called as Figure Window. The most command
used to produce a graph in 2D is the plot command. Syntax- plot ( xdata, ydata )

PROGRAM

clc; clear all; close all;


t=0:.1:2*pi;
y=sin(t);
y1=cos(t);
subplot(2,2,1);
plot(t,y)
title('Continuous sine Plot ');
xlabel('t Time---->')
ylabel('y(t) Amplitude---->')
subplot(2,2,2);
stem(t,y)
title('Discrete sine Plot ');
xlabel('n Time---->')
ylabel('y(n) Amplitude---->')
subplot(2,2,3);
plot(t,y1)
title('Continuous cosine Plot ');
xlabel('t Time---->')
ylabel('y1(t) Amplitude---->')
subplot(2,2,4);
stem(t,y1)
title('Discrete cosine Plot ');
xlabel('n Time---->')
ylabel('y1(n) Amplitude---->')

OUTPUT

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Basic of Simulink

Simulink, developed by MathWorks, is a graphical programming environment for modeling, simulating


and analyzing multidomain 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 automatic
control and digital signal processing for multidomain simulation and Model-Based Design

Simulink/Commonly Used Blocks

(SIMULINK MODEL)

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Automatic Fan Regulator

Automatic fan speed regulator automatically regulates the speed of the fan according to the temperature
inside the room. Due to sudden changes in atmosphere because of pollution, we feel hot and after some
time we feel cold. And we have to regulate the speed of fan..

StateFlow
Stateflow (developed by MathWorks) is a control logic tool used to model reactive systems via state
machines and flow charts within a Simulink model. Stateflow uses a variant of the finite-state machine.

Stateflow ToolBox
Component Used from following path:
Simulink/Stateflow/Chart

(SIMULINK MODEL)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Water Level Indicator

This simple transistor based water level indicator circuit is very useful to indicate the water levels in a
tank. Whenever tank gets filled, we get alerts on particular levels.

StateFlow
Stateflow (developed by MathWorks) is a control logic tool used to model reactive systems via state
machines and flow charts within a Simulink model. Stateflow uses a variant of the finite-state machine.

Stateflow ToolBox
Component Used from following path:
Simulink/Stateflow/Chart

(SIMULINK MODEL)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Halfwave Rectfier

The Half wave rectifier is a circuit, which converts an ac voltage to dc voltage. The primary of the
transformer is connected to ac supply. This induces an ac voltage across the secondary of the
transformer. During the positive half cycle of the input voltage the polarity of the voltage across the
secondary forward biases the diode. As a result a current IL flows through the load resistor, RL. The
forward biased diode offers a very low resistance and hence the voltage drop across it is very small. Thus
the voltage appearing across the load is practically the same as the input voltage at every instant.

SIMScape ToolBox
Component Used from following path:
Simulink/Simscape/Foundation Library/Electrical/Electrical Elements
Simulink/Simscape/Foundation Library/Electrical/Electrical Sensors
Simulink/Simscape/Utilities

(SIMULINK MODEL)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Amplitude Modulation

Amplitude modulation (AM) is a one of the conventional technique used to transmit message signals
using a carrier wave. The amplitude or strength of the high frequency carrier wave is modified in
accordance with amplitude of the message signal.

 Modulated signal= (1+ msin(2 πfmt))*Acsin(2 πfct)


Where,
 Ac = Carrier signal amplitude
 Am = Message signal amplitude
 fc= Carrier frequency
 fm =Message frequency

 Generating AM in Simulink
For generating AM we just have to implement the equation of AM in block level.

Blocks Required
Analyzing the equation we need,

1. Carrier Signal Source


2. Message Signal Source
3. Blocks for viewing the signals – Scope
4. Product Block
5. Summer Block
6. Constant Block

Carrier, Message, Constant blocks

 Simulink –> Sources –> Sine wave


 Simulink –> Sources –> Constant

View Block
 Simulink –> Sink –> Scope
Product and Summer Block
 Simulink –> Math Operations–> Product
 Simulink –> Math Operations–> Summer

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

(SIMULINK MODEL)

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

School of Engineering & Technology


Bhubaneswar Campus

Applied and Action Learning

Experiment No. Date.

Aim of the Experiment:

Equipments Required (if any)

Sl.
Name Specification Qnty
No.

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Edge Detection of Color Image

Although point and line detection certainly are important in any discussion on image segmentation, edge
detection is by far the most common approach for detecting meaningful discontinuities in intensity
values. Such discontinuities are detected by using first- and second-order derivatives

Blocks Required

 Image From File


 Color Space Conversion
 Edge Detection
 Video Viewer

Image From File

Simulink->ComputerVision Toolbox->Source->Image From File

Color Space Conversion

Simulink->ComputerVision Toolbox->Conversions->Color Space Conversion

Edge Detection

Simulink->ComputerVision Toolbox->Analysis & Enhancement-> Edge Detection

Video Viewer

Simulink->ComputerVision Toolbox->Sink-> Video Viewer

(SIMULINK MODEL)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

(OUTPUT)

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

Conclusion

ASSESSMENT
Marks
MARKING PROCEDURE Full Mark Remarks
Obtained
Sketch 10
Sequence of Operation 10
Accuracy &
Use of Tools & Equipment 10
Process
Safety Observation 5
Observation (5)
Report Calculation (10) 25
Graph(10)
Viva 10

Inference 30

Total 100

Signature of Faculty Signature of the student

[ISES1103] SIMULINK MODEL BASED EMBEDDED DESIGN Page:

You might also like