You are on page 1of 3

Capital University of Science and Technology

Department of Electrical Engineering


EE2611 – Signal and Systems Lab
Assignment 1 (BS/EE)
Semester: Spring 2020
Due Date: April 16, 2020
Instructors: Nadir Mehmood
Instructions:
 Attempt all questions.
 Understanding of question is the part of assignment. You can’t consult about any
materials.
 Write your code in an organized and professional way with appropriate syntax and
suppression of unnecessary outputs.
 Good luck and have a nice vacations.

Name: Reg. No:

Question # 1:

a) Create a 15 × 15 identity matrix and display it in the command window, once with
eye() and another with diag() (Hint: diag(ones()) will be useful).

b) Using the MATLAB function zeros, create a 3 x 4 matrix of zeros and store it as the
variable A2.

c)

Create a diagonal matrix from the diagonal entries of matrix A1 and display it in the
command window.

d) Take the transpose of matrix A1 and add it to matrix A1. Is this new matrix
symmetric? Explain.
e) Create an upper triangular matrix from the values of matrix A1 by using the
MATLAB function triu. Display this in the command window.
f) Create a lower triangular matrix from the values of matrix A1 by using the MATLAB
function tril. Display this in the command window.

EE2611-Signals and Systems Lab Page 1 of 3


g) Use the functions triu and tril to create a matrix from A1 that only contains the bottom
left entry and the top right entry. Every other element should be zero. Do not type this
by hand.

Question # 2:

Create a block diagonal matrix consisting of the following matrices,


a. A random 3 x 3 matrix. The function you use is your choice.
b. A 2 x 2 identity matrix added to the scalar 8.
c. The matrix B.

Question # 3:

Find the equation of linear curve fitting by using following data and show the given data and
output equation in same plot like in figure below.
X=[1 2 4 5 6 8 9], Y=[2 5 7 10 12 15 19]
For details, kindly visit the given link: https://www.youtube.com/watch?v=Q9a3Cq2z9Pc

EE2611-Signals and Systems Lab Page 2 of 3


Question # 4:

a. Writing a program to pick the largest number in a list enter by the user in run time.
(Hint: using loop)
b. Writing a program to find the factors of a number enter by the user in run time. (Hint:
using if statement)
c. Write a MATLAB function halfthat removes every other element from an arbitrary
length vector, creating a shorter vector made of only the odd-numbered elements of
the original vector; and a MATLAB function doublethat creates a longer vector by
adding an additional element between neighboring elements in the original vector.
Each new element should equal the average of its neighboringelements. Use only
matrix/ vector manipulations; do NOT use loops. Test your solutionby applying
halfand then double to the vector x = [ x = [1 2 ... 6 7 6 .... 2 1] 1 2 ... 6 7 6 .... 2 1].
What happens after the execution of halffollowed by double, and doublefollowed by
half?

Good Luck😊

EE2611-Signals and Systems Lab Page 3 of 3

You might also like