Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views6 pages

Lab 2 Ss

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

Signal and System Lab

LAB # 02

Spring 2018

Submitted by : Murtaza Ahmad


Registration No : 16PWCSE1427
Class Section: A

“On my honor, as student of University of Engineering and Technology, I have neither given
nor received unauthorized assistance on this academic work.”

Student Signature: ______________

Submitted to:
Miss Dur-e-Nayab
7 March 2018

Department of Computer Systems Engineering


University of Engineering and Technology, Peshawar

TASK 01
Write a program to generate a new matrix B from the matrix A given below such that each
column in the new matrix except the first one is the result of subtraction of that column from
the previous one i.e. 2nd new column is the result of subtraction of 2nd column and 1st column
and so on. Copy the first column as it is in the new matrix.
13 6 9
A= 148
2 8 17

TASK 02
Generate two 2500 sampled random discrete time signals (1 dimensional) using
rand() function
i.e. rand(1, 2500). Write a program to add the two such random signals together
using simple
vector addition.
TASK 03
Using colon notation, generate the following sequence:
-65.25, -57.75, -50.25. . . . . . . . . . ., 54.75,62.25, 69.75

TASK 05
A=[3 7 -4 12

9 10 2 -5

6 13 8 11

15 5 4 1 ]

Find the following:


1) Create 4x3 array B consisting of all elements in the second through fourth columns of A
2) Create 3x4 array C consisting of all elements in the second through fourth rows of A

3) Create 2x3 array D consisting of all elements in the first two rows and the last three
columns of A

TASK 06
MATLAB has functions to round floating point numbers to integers. These are round, fix,
ceil, and floor. Test how these functions work. Determine the output of the following:

f = [‐.5 .1 .5];

1) round(f):
It will round off the number to whole integer if if it is .5 or greater
Like: -1 0 1

2) fix(f):
This will round off the number to some fix value in this case it is:

0 0 0
3) ceil(f)
The ceil function will round off the number to the greater number near it.

0 1 1
4) floor(f)
Simply this function is opposite to ceil function

-1 0 0

TASK 07
A=[-3 5
4 8]
Find the following:

1) Column‐wise sum of all elements of A using sum function; for information about sum
function, type help sum in matlab
2) Column‐wise product of all elements of A using prod function; for information about
prod function, type help prod in matlab

3) Length of matrix A:

4) Size of matrix A:

You might also like