Umal-qura university


-------------------------TASK 6--------------------------



Yüklə 0,73 Mb.
səhifə13/30
tarix23.12.2023
ölçüsü0,73 Mb.
#156716
1   ...   9   10   11   12   13   14   15   16   ...   30
Signal and Systems Manual - v2full

-------------------------TASK 6--------------------------


Create an m‐file that inputs a number from user and then finds out the factorial of that
number.


Lab # 4


OBJECTIVES OF THE LAB
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
This lab will help you grasp the following concepts:

  • Discrete Signal representation in Matlab

  • Matlab Graphics

  • Two Dimensional Plots

  • Plot and subplot

  • Different Plotting Functions Used in Matlab

‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐




    1. DISCRETE-TIME SIGNAL REPRESENTATION IN MATLAB

In MATLAB, finite‐duration sequence (or discrete time signal) is represented by row matrix/vector of appropriate values. Such representation does not have any information about sample position n. Therefore, for correct representation, two vectors are required, one for x and other for n. Consider the following finite duration sequence & its implementation:
x(n) = { 1 ‐1 0 2 1 4 6 }

>> n = [‐3:1:3]
n =
‐3 ‐2 ‐1 0 1 2 3
>> x = [1 ‐1 0 2 1 4 6]
x =
1 ‐1 0 2 1 4 6
NOTE # 01: When the sequence begins at n=0, x‐vector representation alone is enough.


NOTE # 02: An arbitrary infinite‐sequence can’t be represented in MATLAB due to limited memory.
-------------------------TASK 01--------------------------
Given the signals:
x1[n] = [2 5 8 4 3]
x2[n] = [4 3 2]

  1. Write a Matlab program that adds these two signals. Use vector addition and multiplication.

  2. Instead of using vector addition and multiplication, use for loop to add and multiply the signals.




Yüklə 0,73 Mb.

Dostları ilə paylaş:
1   ...   9   10   11   12   13   14   15   16   ...   30




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə