You are on page 1of 6

Name: ____________________________________ Roll No.

______________________

Date: _____________________________________ Instructor: ____________________

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

Basic arithmetic operations can be applied on variables (*, - , /, +)

Vectors and Matrices:

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 = [1 2; 3 4] >> x=[0:0.5:8]

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

B= ans = Corresponding elements were multiplied


A=

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

Some useful functions in MATLAB for linear Algebra are


Command Window:
>> A= [2, 5,4;2,5,6;1,2,3] >>diag (A) >> det(A) >> inv(A)

A= ans = ans = ans =

2 5 4 2 1.5000 -3.5000 5.0000


2

2 5 6 0 1.0000 -2.0000
5

1 2 3 -0.5000 0.5000 0
3

“clear all” and “clc” commands:

clc clears command window

Likewise “clear all” command removes all stored variables from workspace.

Solving Linear Equations:

A system of linear equation such as;


4x+2y=3
Can be written in the matrix form of AX=B
3x+1y=4
Where X=inv (A)*B

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:

Some plotting functions in MATLAB are

Plot Function:

Script Window: Graph:

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. ______________________

Date: _____________________________________ Instructor: ____________________

Experiment 2
Objective:
To investigate Amplitude Modulation (DSB-FC) and the Function of amplitude modulation, and
Demodulation.

Theory:

Modulation is the process of superimposing the information contents of a modulating signal on


a carrier signal (which is of high frequency) by varying the characteristic of carrier signal according to the
modulating signal.

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.

Applications of Amplitude Modulation:

 Used to carry message signals in early telephone lines.

 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.

 Widely used in amateur radio.

DSB-FC (Double Side Band-Full Carrier)

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

You might also like