Lab Assignment # 1
Lab Assignment # 1
Lab Assignment # 1
Lab assignment # 1
E.1 (a)
>> T=[32:2:75]
T=
Columns 1 through 21
32 34 36 38 40 42
68 70 72
Column 22
74
44
46
48
50
52
(b)
>> U=[75:2:131]
U=
Columns 1 through 20
75 77 79 81 83 85 87 89 91 93 95
109 111 113
Columns 21 through 29
115 117 119 121 123 125 127 129 131
(c)
>> A=1:100
A=
Columns 1 through 20
1 2 3 4 5 6
20
Columns 21 through 40
21 22 23 24 25
39 40
Columns 41 through 60
41 42 43 44 45
59 60
Columns 61 through 80
61 62 63 64 65
79 80
Columns 81 through 100
81 82 83 84 85
99 100
E.2 (a)
54
56
58
60
62
64
66
97
10
11
12
13
14
15
16
17
18
19
26
27
28
29
30
31
32
33
34
35
36
37
38
46
47
48
49
50
51
52
53
54
55
56
57
58
66
67
68
69
70
71
72
73
74
75
76
77
78
86
87
88
89
90
91
92
93
94
95
96
97
98
>> X=[2 5 1 6]
X=
2 5 1 6
>> X+16
ans =
18 21 17 22
1.0000
2.4495
14
-2
16
18
20
22
-4
E.(10)
>> O=[12 15 16;23 26 27;31 40 41]
O=
12 15 16
23 26 27
31 40 41
>> P=[22 35 56;63 66 78;24 30 46]
24
26
28
30
32
34
36
P=
22 35
63 66
24 30
>> O+P
ans =
34 50
86 92
55 70
56
78
46
72
105
87
>> O*P
ans =
2805
4692
2404
3480
5781
2980
3593
5988
3080
>> O.*P
ans =
264
1449
744
525
1716
1200
896
2106
1886
>> P-O
ans =
10 20
40 40
-7 -10
40
51
5