Department of Electrical Engineering Communication Systems: LAB-1 Introduction To Matlab
Department of Electrical Engineering Communication Systems: LAB-1 Introduction To Matlab
Communication Systems
Group:
4|Page
Introduction to Matlab
1.1 Objective
To learn to create MATLAB variables, Matrixes and basic plots.
1.2 Equipment/Apparatus
1. Software: Matlab
1.3 Conduct of Lab
1. Students are required to perform this experiment using the equipment provided.
2. Students are required to work in groups specified by lab engineers.
3. Students are advised to seek help from the course instructor, lab engineers, assigned teaching
assistants (TA) and lab attendants.
1.4 Theory
MATLAB is a software program that allows you to do data manipulation and visualization, calculations,
math and programming. MATLAB is recognized as the interactive program for numerical linear algebra and
matrix computation. In industries, MATLAB is used for research and to solve practical engineering and
mathematical problems. In addition, in automatic control theory, statistics and digital signal processing
(Time-Series Analysis) one can use MATLAB. The following toolboxes make it useful in soft computing at
various industrial and scientific areas:
1. Neural Networks
2. Optimization
3. Genetic Algorithms
4. Wavelets
5. Fuzzy Logic
6. Control systems
7. Signal processing
8. Communication Systems
1.5 Procedure
Enter the following commands and note down the results
Result:
>>a=a*5
Result:
1.5.2 Matrix
>>a = [1 2 3; 4 5 6; 7 8 9]
Result:
5|Page
>>a = [1,2,3;4,5,6;7,8,9]
Result:
Result:
Function Task
+ Addition
- Subtraction
* Multiplication
^ Power
Transpose
\ Left Division
/ Right Division
Result:
>>A( : , : )
Result:
>>A(1,2)
Result:
>>A(1, :)
Result:
>>A(: ,[1,3])
Result:
6|Page
1.5.5 Changing and deleting matrix elements:
>>A=1:5
Result:
>>A(2) = 6
Result:
>>A([1 3]) = 0
Result:
But if you intend to perform element-by-element operations, you have to use, .* for multiplication, ./
for division and .^ for exponentiation.
>>A*B
Result:
>>A.*B
Result:
7|Page
xlabel (x = 0:2\pi);
ylabel (sine of x);
title (Plot of the Sine Function)
1. Given that x=-5+9i and y=6-2i, use MATLAB to show that x-y=1+7i, x*y= -12+64i and x/y= -1.2 + 1.1i
2. Use MATLAB to compute: 6(351.4) + 140.35
3. Use MATLAB to plot the functions y=4(6x+1) and z=5e0.3x 2x over the interval 0<x<1.5
4. Use MATLAB to plot function s= 2 sin (3t+2) + (5t+1) over the interval 0<t<5
5. Plot exp(-x) sin(8x) for 0 x 2
6. Plot the function y= (4/) [(sin x) + (sin 3x)/3 + (sin 5x)/5 + (sin7x)/7] over the interval <x<. These
are the first four terms of the Fourier Series representation of a square wave.
7. Define a 4x3 matrix with zeros everywhere except the first line that is filled with 1. Hint= use ones
and zeros command
8. Use MATLAB to find roots of 13x3 + 182x2 184x +2503 = 0 Hint= use roots command
1.7 Student Learning Outcomes
What you have learnt in the lab? Describe.
8|Page