Professional Documents
Culture Documents
______________________
Experiment 1
Objective:
To understand and investigate commands of MATLAB
Theory:
The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy
access to matrix software developed by the LINPACK and EISPACK projects, which together represent
the state-of-the-art in software for matrix computation. MATLAB is a high-performance language for
technical computing. It integrates computation, visualization, and programming in an easy-to-use
environment where problems and solutions are expressed in familiar mathematical notation. MATLAB is
a high-performance language for technical computing. It integrates computation, visualization, and
programming in an easy-to-use environment where problems and solutions are expressed in familiar
mathematical notation.
MATLAB Basics:
Variables
Variables are defined with the assignment operator, “=”. MATLAB is dynamically typed, meaning that variables can
be assigned without declaring their type, and that their type can change
Command Window:
>> x = 3 >>x+y
x=
ans=
3
4.5708
>> y = pi/2
y=
1.5708
Matrices and vectors (Linear Algebra) are the basic elements in MATLAB and also the basic elements in control
design theory. So it is important you know how to handle vectors and matrices in MATLAB.
Command Window: Command Window:
A=12 x=
34 Columns 1 through 10
To get a specific part of a matrix, we 0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000
can type like this:
Columns 11 through 17
A (2, 1)
5.0000 5.5000 6.0000 6.5000 7.0000 7.5000 8.0000
ans =
Where x= [initial value: increment/decrement: final value]
3
Array Operations: Basic Arithmetic operations can also be performedon matrices such as addition, division, subtraction and
multiplication.
Command Window:
>> A = [1; 2; 3] >> B = [-6; 7; 10] >> A.*B
1 -6 -6
2 7 14
3 10 30
For Matrix Multiplication A*B Dimensions of two matrices should be such that column of matrix should be equal to row of
matrix B.
Command Window:
>> A= [2 3; 4 5; 2 3] >> B= [3 3; 4 4] >> A*B
ans =
A= B= This example follows matrices rule of
multiplication
18 18
2 3 3 3
32 32
4 5
4 4
18 18
2 3
2 5 6 0 1.0000 -2.0000
5
1 2 3 -0.5000 0.5000 0
3
Likewise “clear all” command removes all stored variables from workspace.
Command Window:
>> A=[4,2;3,1] >> B=[3;4] >> X=inv (A)*B
A= B= X=
4 2 2.5000
3
3 1 -3.5000
4
Plotting In MATLAB:
Plot Function:
x=[-360:10:360]
y=sind(x)
z=cosd(x)
plot(x,y,x,z)
title('2kx6-EE-137')
legend('sinx','cosx')
xlabel('phase')
ylabel('sin(x),cos(x)')
Conclusion:
Name: ____________________________________ Roll No. ______________________
Experiment 2
Objective:
To investigate Amplitude Modulation (DSB-FC) and the Function of amplitude modulation, and
Demodulation.
Theory:
amplitude modulation is defined as a system of modulation in which the amplitude of a carrier wave is
varied in accordance with some characteristic of the modulating signal.
Used to transmit Morse code using radio and other communication systems.
Used in Navy and Aviation for communications as AM signals can travel longer distances.
In DSB-FC carrier wave is modulated along with message signal. In DSB-FC AM transmitters are less
complex. AM receivers being simple and cost efficient. But there are some drawbacks too. Power
wastage takes place due to carrier wave. Carrier wave carries most of the power and it does not contain
any information. Also DSB-FC system is bandwidth inefficient system.
Mathematical Derivation
MATLAB Script