n=
-5
-4
-3
-2
-1
>> x = 2*impseq(-2,-5,5)
x=
>> x1 = impseq(4,-5,5)
x1 =
-1
>> x2 = x-x1
x2 =
Coba 2
>> n = -3:3
n=
-3
-2
-1
>> x1 = 3*impseq(-1,-3,3)
x1 =
x2 =
>> x3 = 3*impseq(2,-3,3)
x3 =
>> x = x1+x2-x3
Error using +
Matrix dimensions must agree.
>> x = x1 + x2 - x3
Error using +
Matrix dimensions must agree.
x2 =
-3
>> x = x1+x2-x3
x=
n=
Columns 1 through 12
10
11
Columns 13 through 21
12
13
14
15
16
17
18
19
20
>> x1 = stepseq(0,0,20)
x1 =
Columns 1 through 12
Columns 13 through 21
>> x2 = stepseq(10,0,20)
x2 =
Columns 1 through 12
Columns 13 through 21
>> x = x1 - x2
x=
Columns 1 through 11
Columns 12 through 21
n=
Columns 1 through 12
10
11
Columns 13 through 21
12
13
14
15
16
17
18
19
20
>> x1 = 2*stepseq(0,0,20)
x1 =
Columns 1 through 12
Columns 13 through 21
>> x2 = 3*stepseq(5,0,20)
x2 =
Columns 1 through 12
Columns 13 through 21
>> x3 = stepseq
Error using stepseq (line 11)
Not enough input arguments.
>> x3 = stepseq(10,0,20)
x3 =
Columns 1 through 11
Columns 12 through 21
>> x = x1+x2-x3
x=
Columns 1 through 11
Columns 12 through 21
Cobaaaa putar
x=
0.5469
0.9575
0.9649
0.1576
0.9706
0.9572
0.4854
0.9706
0.1576
0.9649
0.9575
0.5469
1.9355
0.3152
1.9355
1.9147
1.0323
x1 =
0.4854
0.9572
even =
1.0323
1.9147
odd =
0.0615
0.0003 -0.0057
sinyalasli =
0.5469
0.9575
0.9649
0.1576
0.9706
0.9572
11
n=
Columns 1 through 12
Columns 13 through 21
12
13
14
15
16
>> x1 = stepseq(0,0,20)
x1 =
Columns 1 through 12
17
18
19
20
10
0.4854
Columns 13 through 21
>> x2 = stepseq(10,0,20)
x2 =
Columns 1 through 12
Columns 13 through 21
>> x3 = n*(x1-x2)
Error using *
Inner matrix dimensions must agree.
>> x3 = n[(x1-x2)]
x3 = n[(x1-x2)]
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> x3 = n.*[(x1-x2)]
x3 =
Columns 1 through 11
Columns 12 through 21
>> x4 = 10*exp(-0.3*(n-10))
x4 =
Columns 1 through 7
Columns 8 through 14
7.4082
5.4881
4.0657
Columns 15 through 21
3.0119
2.2313
1.6530
1.2246
0.9072
>> x5 = stepseq(10,0,20)
x5 =
Columns 1 through 11
0.6721
0.4979
Columns 12 through 21
>> x6 = stepseq(20,0,20)
x6 =
Columns 1 through 11
Columns 12 through 21
>> x7 = x5-x6
x7 =
Columns 1 through 11
Columns 12 through 21
>> x = x3+x4*x7
Error using *
Inner matrix dimensions must agree.
>> x = x3+x4*(x7)
Error using *
Inner matrix dimensions must agree.
>> x = x3+x4.*(x7)
x=
Columns 1 through 7
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
Columns 8 through 14
7.0000
8.0000
9.0000 10.0000
7.4082
5.4881
4.0657
Columns 15 through 21
3.0119
2.2313
1.6530
1.2246
0.9072
Example 2.1 c
>> n = 0:50
n=
Columns 1 through 11
Columns 12 through 22
10
0.6721
11
12
13
14
15
16
17
18
19
20
21
27
28
29
30
31
32
38
39
40
41
42
43
49
50
Columns 23 through 33
22
23
24
25
26
Columns 34 through 44
33
34
35
36
37
Columns 45 through 51
44
45
46
47
48
>> x1 = cos*(0.04*pi.*n)
Error using cos
Not enough input arguments.
>> x1 = cos(0.04*pi.*n)
x1 =
Columns 1 through 6
1.0000
0.9921
0.9686
0.9298
0.8763
0.8090
0.4258
0.3090
0.1874
Columns 7 through 12
0.7290
0.6374
0.5358
Columns 13 through 18
Columns 19 through 24
Columns 25 through 30
Columns 31 through 36
Columns 37 through 42
-0.1874 -0.0628
0.0628
0.1874
0.3090
0.4258
0.8090
0.8763
0.9298
Columns 43 through 48
0.5358
0.6374
0.7290
Columns 49 through 51
0.9686
0.9921
1.0000
>> x2 = 0.2*rand(0,50)
x2 =
>> x2 = 0.2*rand(0:50)
x2 =
>> x2 = 0.2*randn(0:50)
x2 =
>> x2 = 0.2*randn(n)
x2 =
>> x2 = 0.2*randn(size(n))
x2 =
Columns 1 through 6
0.2979
0.2818
0.2834
0.3260
0.0978
0.2069
Columns 7 through 12
0.1343 -0.2415
0.1434
Columns 13 through 18
0.1454 -0.0607
0.0588 -0.1575
0.1777 -0.2294
Columns 19 through 24
0.2877
0.0650 -0.1510
Columns 25 through 30
0.0638
0.0626
0.2187
0.2219
0.3065
Columns 31 through 36
0.1255
Columns 37 through 42
-0.1727
Columns 43 through 48
-0.1539
0.0743 -0.0451
Columns 49 through 51
0.2235 -0.2178
0.0065
0.1105
0.2201
0.3088
>> x = x1+x2
x=
Columns 1 through 6
1.1429
0.9511
0.9438
1.2277
1.1581
1.0925
0.7518
0.4068
0.3943
Columns 7 through 12
0.8633
0.3959
0.6793
Columns 13 through 18
Columns 19 through 24
Columns 25 through 30
Columns 31 through 36
Columns 37 through 42
0.3076
0.7323
0.6585
0.9363
Columns 43 through 48
0.3819
0.7117
0.6839
Columns 49 through 51
1.0791
1.2122
>> stem(x)
>>
Example 2.1d
1.3088
1.0325