-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab4_tut_2.m
58 lines (44 loc) · 769 Bytes
/
lab4_tut_2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
close all;
clear variables;
clc;
dt=0.025;
t1=0:dt:0.5;
t2=0.5:dt:1;
t=[t1 t2];
x1=exp(-5*t1);
x2=flip(x1);
x=[x1 x2];
figure(1);
subplot(141)
plot(t,x); title('x(t)')
tshift=t-0.5;
subplot(142)
plot(tshift,x); title('x2(t), shifted x(t)');
xeven=(x+flip(x))/2;
xodd=(x-flip(x))/2;
subplot(143);
plot(tshift,xeven); title('even part of x2(t)');
subplot(144);
plot(tshift,xodd); title('odd part of x2(t)');
%%
t3=(t1+1)/2;
x3=exp(-5*t1);
figure(2);
subplot(121);
plot(t1,x3);
subplot(122);
plot(t3,x3);
%%
dT=0.01;
t=0:dt:1;
f1=abs(cos(100*pi*t));
f2=exp(-5*t);
f3=5*f1+3*f2;
o1=sum(f1);
o2=sum(f2);
o3=sum(f3);
if o3==sum(5*f1+3*f2)
disp('linear system');
else
disp('nonlinear system');
end