0% found this document useful (0 votes)
2 views

MATLAB Problem Set 1_SP25

The document outlines a MATLAB problem set for the ELE540 Communication Systems Lab, detailing four main problems that involve matrix manipulations, vector creation, and probability density functions. Each problem requires specific MATLAB commands and operations, such as building matrices, performing calculations, and plotting functions. Submission instructions include creating a ZIP folder with M-files and a report, all named according to specified guidelines.

Uploaded by

lourdes.gerges
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MATLAB Problem Set 1_SP25

The document outlines a MATLAB problem set for the ELE540 Communication Systems Lab, detailing four main problems that involve matrix manipulations, vector creation, and probability density functions. Each problem requires specific MATLAB commands and operations, such as building matrices, performing calculations, and plotting functions. Submission instructions include creating a ZIP folder with M-files and a report, all named according to specified guidelines.

Uploaded by

lourdes.gerges
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ELE540 Communication Systems LAB

Spring 2025

Instructor: Ms. Jessica Korkmaz

MATLAB Problem Set 1

Note: The submission on Blackboard should include a ZIP folder containing 4 M-files (an M-file for each
problem) along with a report in .docx format. The folder should be named as MATLAB_PS1_Your names.

Problem 1

1. Find a short MATLAB expression (dynamic way) to build the matrix A defined as follows:

1 2 3 4 5 6 7
𝐴 = [9 7 5 3 1 −1 −3 ]
4 8 16 32 64 128 256

2. Give a MATLAB expression that uses only a single matrix multiplication with A to obtain:

a. The last row of A.

b. A version of matrix A with rows 2 and 3 swapped.

3. Define the matrix X given as follows:


2 16 37
𝑋 = [43 7 51]
7 23 86

Using a single MATLAB command, perform the following operations:

a. Add 7 to each element of X and save the new matrix in Y.

b. Add 4 to just the odd-index rows of X (dynamic way) and save the new matrix in Z (can
be done in two commands).

c. Compute the square root of each element of matrix Z and save the new matrix in W.

Problem 2
Create a vector x with the elements,

(−1)𝑛+1 𝑛
𝑥𝑛 = 𝑛 = 1,2,3,4, … ,100
𝑛+1
Add up the elements of this vector.

1|Page
Problem 3

Build the matrix A defined as follows:

2 17 15 7 9
6 18 5 3 1
𝐴=[ ]
9 8 65 2 31
10 54 13 40 11

Given the matrix A above, provide the command that will:

1. Assign the odd-numbered columns of A to an array called B (dynamic way).

2. Assign the even-numbered rows of A to an array called C (dynamic way).

3. Convert A into a 5-by-4 matrix in two different ways. Store the resultant matrices in D and E.

4. Compute the inverse of each element of A and save the new matrix in F.

5. Add a random row to A and then compute its inverse. The random row should be composed of
random integer numbers from 2 to 20 (Use the randi command of MATLAB).

Problem 4

The probability density function (PDF) of the Rayleigh distribution is given in the expression below:

𝑥 (−𝑥22 )
𝑓 (𝑥, 𝜎) = 2 𝑒 2𝜎
𝜎
1. Define vectors x and f such as:

▪ x represents the interval [0;10] with step size of 0.001 (or 1e-3).

▪ f contains the values of the PDF function defined over the interval x (with 𝜎 = 1).

2. Plot the PDF of the Rayleigh distribution with the above specifications.

3. Using the numerical integration method, generate the array F which represents the cumulative
distribution function (CDF) of the Rayleigh distribution.

Note: The CDF is the integral of the PDF over the interval of x.

4. Plot on a new figure the CDF curve along with the PDF curve on the same graph.

5. Using the numerical integration method, show that:

2
Pr(0 < 𝑋 < 2) = ∫ 𝑓(𝑥, 1) 𝑑𝑥 ≈ 0.8648
0
Note: The answer to this question should be stored in a variable called Prob1.

2|Page
6. We define the random variable 𝑌 = 𝑡𝑎𝑛(𝑋 2 ) where X is a random variable following the
Rayleigh distribution. Using the numerical integration, show that the expected value of Y is:

10
𝐸[𝑌] = ∫ tan(𝑥 2 ) × 𝑓(𝑥, 1) 𝑑𝑥 ≈ 0.5281
0

Note: The answer to this question should be stored in a variable called Prob2.

3|Page

You might also like