LAB 5 Matlab PDF
LAB 5 Matlab PDF
Vectors
Declaration:
Operation on Vectors:
Polynomials in MATLAB
Example: Integrate Vector of Data with Non unit Spacing
Create a domain vector, X.
X = 0:pi/100:pi;
Q = 1.9998
When the spacing between points is constant, but not equal to 1, you can multiply by the spacing
value, in this case pi/100*trapz(Y). The answer is the same if you pass the value directly to the
function with trapz(X,Y).
Asking user for Input:
t=input('Enter the Value of time');
Note: Time value entered by user is stored in variable t (e.g. enter [-3:3])
Linearity:
Dot Product:
To take Dot product of two matrices, we use dot following command. Dimensions of vectors should
must agree to perform calculation. a=[0:4] b=[4:8]
dot(a,b)
A time-variant system is a system that is not time invariant (TIV). Roughly speaking, its output
characteristics depend explicitly upon time. A system is said to be Time variant if its input output
characteristics changes with time.
Explanation:
Time invariant systems are those systems whose input output characteristics do not change with
time shifting. Let us consider x(n) be the input to the system which produces output y(n) as shown
in figure below.
Now delay input by k samples, it means our new input will become x(n-k). Now apply this delayed
input x(n-k) to the same system as shown in figure below.
Now if the output of this system also delayed by k samples (i.e. if output is equal to y(n-k)) then
this system is said to be Time invariant (or shift invariant) system.
If we observe carefully, x(n) is the initial input to the system which gives output y(n), if we delayed
input by k samples output is also delayed by same (k) samples. Thus we can say that input output
characteristics of the system do not change with time. Hence it is Time invariant system.
Now let us discuss about How to determine that the given system is Time invariant or not? To
determine whether the given system is Time Invariant or Time Variant, we have to follow the
following steps:
Step 1: Delay the input x(n) by k samples i.e. x(n-k). Denote the corresponding output by y(n,k).
That means x(n-k) → y(n,k)
Step 2: In the given equation of system y(n) replace ‘n’ by ‘n-k’ throughout. Thus the output is
y(n-k).
Step 3: If y(n,k) = y(n-k) then the system is time invariant (TIV) and if y(n,k) ≠ y(n-k) then
system is time variant (TV).
Same steps are applicable for the continuous time systems.
Task 2:
Task 3
Task 4
Task 5: