Title | EGR 270 Problems 38 and 40 |
---|---|
Course | Elem Software Engr |
Institution | Clemson University |
Pages | 6 |
File Size | 114.5 KB |
File Type | |
Total Downloads | 101 |
Total Views | 142 |
MatLab Work...
Catherine Ward Section 270-008 HW #12 T=rand(300,3) T = 300×3 0.4716 0.5430 0.0597 0.6580 0.8896 0.1096 0.4378 0.2802 0.9852 0.6088
0.3796 0.3191 0.9861 0.7182 0.4132 0.0986 0.7346 0.6373 0.0738 0.1205
0.5470 0.4030 0.1070 0.7242 0.6137 0.7830 0.5666 0.8113 0.5768 0.9440
array2table(T,'variableNames',{'x','y','z'}) ans = 300×3 table x
y
z
1
0.4716
0.3796
0.5470
2
0.5430
0.3191
0.4030
3
0.0597
0.9861
0.1070
4
0.6580
0.7182
0.7242
5
0.8896
0.4132
0.6137
6
0.1096
0.0986
0.7830
7
0.4378
0.7346
0.5666
8
0.2802
0.6373
0.8113
9
0.9852
0.0738
0.5768
10
0.6088
0.1205
0.9440
11
0.2537
0.9816
0.8715
12
0.1326
0.4968
0.5076
13
0.5450
0.0224
0.7888
14
0.8278
0.0538
0.4730
15
0.8370
0.1409
0.8288
16
0.8333
0.8935
0.3225
17
0.2037
0.4658
0.9761
18
0.5444
0.5609
0.2782
19
0.8749
0.4945
0.0728
1
x
y
z
20
0.1210
0.0678
0.7512
21
0.8564
0.8976
0.8312
22
0.8998
0.2886
0.9223
23
0.2179
0.2690
0.3270
24
0.0770
0.5942
0.8041
25
0.4742
0.4759
0.5383
26
0.8350
0.3683
0.4633
27
0.4694
0.6556
0.8208
28
0.4138
0.9382
0.9519
29
0.5027
0.6204
0.0763
30
0.1254
0.2828
0.7087
31
0.1323
0.2052
0.2349
32
0.8705
0.4391
0.3989
33
0.6030
0.0273
0.2681
34
0.2653
0.8762
0.8325
35
0.8648
0.6101
0.9954
36
0.0581
0.2036
0.6498
37
0.4578
0.5199
0.7040
38
0.7222
0.0538
0.9323
39
0.3390
0.8622
0.6877
40
0.4012
0.4429
0.5684
41
0.5270
0.5480
0.3808
42
0.8942
0.5669
0.6346
43
0.7784
0.6804
0.3632
44
0.0694
0.3714
0.4076
45
0.2788
0.0782
0.3687
46
0.3794
0.4564
0.4684
47
0.8647
0.0478
0.5034
48
0.4200
0.7383
0.9105
49
0.2399
0.0380
0.2064
50
0.5977
0.9542
0.3386
51
0.4794
0.7424
0.5741
52
0.8985
0.9374
0.4869
53
0.9347
0.5134
0.2622
2
x
y
z
54
0.8179
0.2409
0.5796
55
0.7089
0.2600
0.8783
56
0.7432
0.7590
0.0610
57
0.8997
0.9933
0.4409
58
0.0652
0.3567
0.0843
59
0.3359
0.7529
0.5632
60
0.0043
0.1100
0.5393
61
0.8281
0.5970
0.7681
62
0.5074
0.4306
0.2331
63
0.3662
0.7307
0.5874
64
0.2266
0.2612
0.4590
65
0.5348
0.0948
0.8610
66
0.2895
0.4510
0.6608
67
0.0684
0.6401
0.3539
68
0.0850
0.1320
0.3472
69
0.0683
0.4528
0.2537
70
0.4098
0.6522
0.9525
71
0.1234
0.8270
0.2982
72
0.4430
0.3081
0.1584
73
0.8989
0.4024
0.3613
74
0.3536
0.8842
0.7416
75
0.1202
0.7006
0.7059
76
0.5691
0.2419
0.7009
77
0.8750
0.7598
0.0062
78
0.3486
0.2909
0.3743
79
0.0419
0.2774
0.9015
80
0.1423
0.0061
0.3183
81
0.0766
0.3747
0.5971
82
0.7405
0.4369
0.2978
83
0.4565
0.3043
0.1250
84
0.6682
0.2909
0.3884
85
0.6992
0.2425
0.8177
86
0.5714
0.9367
0.9812
87
0.6287
0.8602
0.8620
3
x
y
z
88
0.8778
0.3972
0.0838
89
0.6624
0.4794
0.3377
90
0.8754
0.5650
0.2361
91
0.4675
0.4896
0.3178
92
0.1413
0.2698
0.9844
93
0.0681
0.9897
0.5483
94
0.7142
0.1837
0.7493
95
0.3080
0.8617
0.8419
96
0.6712
0.0326
0.1669
97
0.6524
0.3320
0.9031
98
0.5310
0.7487
0.1051
99
0.7151
0.6444
0.7451
100
0.5048
0.1692
0.7294
Problem #38 unit_cost=[7,3,2;3,1,3;9,4,5;2,5,4;6,2,1] unit_cost = 5×3 7 3 3 1 9 4 2 5 6 2
2 3 5 4 1
quarterly_volume=[16,14,10,12;12,15,11,13;8,9,7,11;14,13,15,17;13,16,12,18] quarterly_volume = 5×4 16 14 10 12 12 15 11 13 8 9 7 11 14 13 15 17 13 16 12 18
quarterly_cost=unit_cost'*quarterly_volume quarterly_cost 326 346 188 190 177 186
= 3×4 268 364 168 214 160 204
The quarterly cost for Materials (1), Labor (2), and Transportation (3) are listed in the table below array2table(quarterly_cost,'VariableNames',{'Q1','Q2','Q3','Q4'}) ans = 3×4 table
4
Q1
Q2
Q3
Q4
1
326
346
268
364
2
188
190
168
214
3
177
186
160
204
The Total Costs for the year for Mterials, Labor, and Transportation are shown in the table below yearly_cost=sum(quarterly_cost') yearly_cost = 1×3 1304
760
727
array2table(yearly_cost,'VariableNames',{'Materials','Labor','Transportation'}) ans = 1×3 table Materials 1
Labor
1304
Transportation
760
727
Problem #40 unit_costs=[6,2,2;2,5,4;4,3,2;9,7,3] unit_costs 6 2 4 9
= 4×3 2 2 5 4 3 2 7 3
quarterly_costs=unit_costs'*quarterly_production quarterly_costs = 3×4 178 162 241 179 138 117 172 112 94 84 109 79
quarterly_production=[10,12,13,15;8,7,6,4;12,10,13,9;6,4,11,5] quarterly_production = 4×4 10 12 13 15 8 7 6 4 12 10 13 9 6 4 11 5
array2table(unit_costs,'VariableNames',{'Materials','Labor','Transportation'}) ans = 4×3 table Materials
Labor
Transportation
1
6
2
2
2
2
5
4
3
4
3
2
4
9
7
3
array2table(quarterly_production,'VariableNames',{'Q1','Q2','Q3','Q4'}) 5
ans = 4×4 table Q1
Q2
Q3
Q4
1
10
12
13
15
2
8
7
6
4
3
12
10
13
9
4
6
4
11
5
array2table(quarterly_costs,'VariableNames',{'Q1','Q2','Q3','Q4'}) ans = 3×4 table Q1
Q2
Q3
Q4
1
178
162
241
179
2
138
117
172
112
3
94
84
109
79
6...