I need help with these two questions 412 and 413 dealing wit

I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance.




Solution

clear all;
bigBal=2*10^5;
endBal=bigBal;
i=1;
payment=1199.11;
while endBal>0
    A(i)=endBal*(1+0.5/100);
    B(i)=payment;
    C(i)=A(i)-B(i);
    endBal=C(i);
    i=i+1;
end
fileID = fopen(\'exp.txt\',\'w\');
x=1:1:(i-1);
M=[x; A; B; C];
fprintf(fileID,\'%4s %12s %12s %12s\ \',\'month\',\'Beg Balance\',\'payment\', \'end Balance\');
fprintf(fileID,\'%6.2f %12.2f %8.2f %6.2f\ \',M);

type exp.txt
if endBal<0
    fprintf(\' Final balance amount to be refunded is: %f\', -endBal);
end

%out put

month Beg Balance      payment end Balance
1.00    201000.00 1199.11 199800.89
2.00    200799.89 1199.11 199600.78
3.00    200598.79 1199.11 199399.68
4.00    200396.68 1199.11 199197.57
5.00    200193.55 1199.11 198994.44
6.00    199989.42 1199.11 198790.31
7.00    199784.26 1199.11 198585.15
8.00    199578.07 1199.11 198378.96
9.00    199370.86 1199.11 198171.75
10.00    199162.61 1199.11 197963.50
11.00    198953.32 1199.11 197754.21
12.00    198742.98 1199.11 197543.87
13.00    198531.59 1199.11 197332.48
14.00    198319.14 1199.11 197120.03
15.00    198105.63 1199.11 196906.52
16.00    197891.05 1199.11 196691.94
17.00    197675.40 1199.11 196476.29
18.00    197458.67 1199.11 196259.56
19.00    197240.86 1199.11 196041.75
20.00    197021.96 1199.11 195822.85
21.00    196801.96 1199.11 195602.85
22.00    196580.87 1199.11 195381.76
23.00    196358.67 1199.11 195159.56
24.00    196135.35 1199.11 194936.24
25.00    195910.92 1199.11 194711.81
26.00    195685.37 1199.11 194486.26
27.00    195458.70 1199.11 194259.59
28.00    195230.88 1199.11 194031.77
29.00    195001.93 1199.11 193802.82
30.00    194771.84 1199.11 193572.73
31.00    194540.59 1199.11 193341.48
32.00    194308.19 1199.11 193109.08
33.00    194074.62 1199.11 192875.51
34.00    193839.89 1199.11 192640.78
35.00    193603.98 1199.11 192404.87
36.00    193366.90 1199.11 192167.79
37.00    193128.63 1199.11 191929.52
38.00    192889.16 1199.11 191690.05
39.00    192648.50 1199.11 191449.39
40.00    192406.64 1199.11 191207.53
41.00    192163.57 1199.11 190964.46
42.00    191919.28 1199.11 190720.17
43.00    191673.77 1199.11 190474.66
44.00    191427.04 1199.11 190227.93
45.00    191179.07 1199.11 189979.96
46.00    190929.86 1199.11 189730.75
47.00    190679.40 1199.11 189480.29
48.00    190427.69 1199.11 189228.58
49.00    190174.72 1199.11 188975.61
50.00    189920.49 1199.11 188721.38
51.00    189664.99 1199.11 188465.88
52.00    189408.21 1199.11 188209.10
53.00    189150.14 1199.11 187951.03
54.00    188890.79 1199.11 187691.68
55.00    188630.14 1199.11 187431.03
56.00    188368.18 1199.11 187169.07
57.00    188104.92 1199.11 186905.81
58.00    187840.34 1199.11 186641.23
59.00    187574.43 1199.11 186375.32
60.00    187307.20 1199.11 186108.09
61.00    187038.63 1199.11 185839.52
62.00    186768.72 1199.11 185569.61
63.00    186497.46 1199.11 185298.35
64.00    186224.84 1199.11 185025.73
65.00    185950.86 1199.11 184751.75
66.00    185675.50 1199.11 184476.39
67.00    185398.78 1199.11 184199.67
68.00    185120.66 1199.11 183921.55
69.00    184841.16 1199.11 183642.05
70.00    184560.26 1199.11 183361.15
71.00    184277.96 1199.11 183078.85
72.00    183994.24 1199.11 182795.13
73.00    183709.11 1199.11 182510.00
74.00    183422.55 1199.11 182223.44
75.00    183134.56 1199.11 181935.45
76.00    182845.12 1199.11 181646.01
77.00    182554.24 1199.11 181355.13
78.00    182261.91 1199.11 181062.80
79.00    181968.11 1199.11 180769.00
80.00    181672.85 1199.11 180473.74
81.00    181376.11 1199.11 180177.00
82.00    181077.88 1199.11 179878.77
83.00    180778.17 1199.11 179579.06
84.00    180476.95 1199.11 179277.84
85.00    180174.23 1199.11 178975.12
86.00    179870.00 1199.11 178670.89
87.00    179564.24 1199.11 178365.13
88.00    179256.96 1199.11 178057.85
89.00    178948.13 1199.11 177749.02
90.00    178637.77 1199.11 177438.66
91.00    178325.85 1199.11 177126.74
92.00    178012.38 1199.11 176813.27
93.00    177697.33 1199.11 176498.22
94.00    177380.71 1199.11 176181.60
95.00    177062.51 1199.11 175863.40
96.00    176742.72 1199.11 175543.61
97.00    176421.33 1199.11 175222.22
98.00    176098.33 1199.11 174899.22
99.00    175773.71 1199.11 174574.60
100.00    175447.48 1199.11 174248.37
101.00    175119.61 1199.11 173920.50
102.00    174790.10 1199.11 173590.99
103.00    174458.95 1199.11 173259.84
104.00    174126.14 1199.11 172927.03
105.00    173791.66 1199.11 172592.55
106.00    173455.51 1199.11 172256.40
107.00    173117.69 1199.11 171918.58
108.00    172778.17 1199.11 171579.06
109.00    172436.95 1199.11 171237.84
110.00    172094.03 1199.11 170894.92
111.00    171749.40 1199.11 170550.29
112.00    171403.04 1199.11 170203.93
113.00    171054.95 1199.11 169855.84
114.00    170705.12 1199.11 169506.01
115.00    170353.54 1199.11 169154.43
116.00    170000.20 1199.11 168801.09
117.00    169645.10 1199.11 168445.99
118.00    169288.22 1199.11 168089.11
119.00    168929.55 1199.11 167730.44
120.00    168569.09 1199.11 167369.98
121.00    168206.83 1199.11 167007.72
122.00    167842.76 1199.11 166643.65
123.00    167476.87 1199.11 166277.76
124.00    167109.15 1199.11 165910.04
125.00    166739.59 1199.11 165540.48
126.00    166368.18 1199.11 165169.07
127.00    165994.92 1199.11 164795.81
128.00    165619.79 1199.11 164420.68
129.00    165242.78 1199.11 164043.67
130.00    164863.89 1199.11 163664.78
131.00    164483.10 1199.11 163283.99
132.00    164100.41 1199.11 162901.30
133.00    163715.81 1199.11 162516.70
134.00    163329.28 1199.11 162130.17
135.00    162940.82 1199.11 161741.71
136.00    162550.42 1199.11 161351.31
137.00    162158.07 1199.11 160958.96
138.00    161763.75 1199.11 160564.64
139.00    161367.47 1199.11 160168.36
140.00    160969.20 1199.11 159770.09
141.00    160568.94 1199.11 159369.83
142.00    160166.68 1199.11 158967.57
143.00    159762.40 1199.11 158563.29
144.00    159356.11 1199.11 158157.00
145.00    158947.79 1199.11 157748.68
146.00    158537.42 1199.11 157338.31
147.00    158125.00 1199.11 156925.89
148.00    157710.52 1199.11 156511.41
149.00    157293.97 1199.11 156094.86
150.00    156875.33 1199.11 155676.22
151.00    156454.60 1199.11 155255.49
152.00    156031.77 1199.11 154832.66
153.00    155606.82 1199.11 154407.71
154.00    155179.75 1199.11 153980.64
155.00    154750.55 1199.11 153551.44
156.00    154319.19 1199.11 153120.08
157.00    153885.68 1199.11 152686.57
158.00    153450.01 1199.11 152250.90
159.00    153012.15 1199.11 151813.04
160.00    152572.11 1199.11 151373.00
161.00    152129.86 1199.11 150930.75
162.00    151685.40 1199.11 150486.29
163.00    151238.73 1199.11 150039.62
164.00    150789.81 1199.11 149590.70
165.00    150338.66 1199.11 149139.55
166.00    149885.25 1199.11 148686.14
167.00    149429.57 1199.11 148230.46
168.00    148971.61 1199.11 147772.50
169.00    148511.36 1199.11 147312.25
170.00    148048.81 1199.11 146849.70
171.00    147583.95 1199.11 146384.84
172.00    147116.76 1199.11 145917.65
173.00    146647.24 1199.11 145448.13
174.00    146175.37 1199.11 144976.26
175.00    145701.14 1199.11 144502.03
176.00    145224.54 1199.11 144025.43
177.00    144745.56 1199.11 143546.45
178.00    144264.18 1199.11 143065.07
179.00    143780.40 1199.11 142581.29
180.00    143294.20 1199.11 142095.09
181.00    142805.56 1199.11 141606.45
182.00    142314.48 1199.11 141115.37
183.00    141820.95 1199.11 140621.84
184.00    141324.95 1199.11 140125.84
185.00    140826.47 1199.11 139627.36
186.00    140325.50 1199.11 139126.39
187.00    139822.02 1199.11 138622.91
188.00    139316.02 1199.11 138116.91
189.00    138807.50 1199.11 137608.39
190.00    138296.43 1199.11 137097.32
191.00    137782.81 1199.11 136583.70
192.00    137266.61 1199.11 136067.50
193.00    136747.84 1199.11 135548.73
194.00    136226.48 1199.11 135027.37
195.00    135702.50 1199.11 134503.39
196.00    135175.91 1199.11 133976.80
197.00    134646.68 1199.11 133447.57
198.00    134114.81 1199.11 132915.70
199.00    133580.28 1199.11 132381.17
200.00    133043.08 1199.11 131843.97
201.00    132503.18 1199.11 131304.07
202.00    131960.60 1199.11 130761.49
203.00    131415.29 1199.11 130216.18
204.00    130867.26 1199.11 129668.15
205.00    130316.49 1199.11 129117.38
206.00    129762.97 1199.11 128563.86
207.00    129206.68 1199.11 128007.57
208.00    128647.61 1199.11 127448.50
209.00    128085.74 1199.11 126886.63
210.00    127521.06 1199.11 126321.95
211.00    126953.56 1199.11 125754.45
212.00    126383.23 1199.11 125184.12
213.00    125810.04 1199.11 124610.93
214.00    125233.98 1199.11 124034.87
215.00    124655.05 1199.11 123455.94
216.00    124073.22 1199.11 122874.11
217.00    123488.48 1199.11 122289.37
218.00    122900.81 1199.11 121701.70
219.00    122310.21 1199.11 121111.10
220.00    121716.66 1199.11 120517.55
221.00    121120.13 1199.11 119921.02
222.00    120520.63 1199.11 119321.52
223.00    119918.13 1199.11 118719.02
224.00    119312.61 1199.11 118113.50
225.00    118704.07 1199.11 117504.96
226.00    118092.48 1199.11 116893.37
227.00    117477.84 1199.11 116278.73
228.00    116860.13 1199.11 115661.02
229.00    116239.32 1199.11 115040.21
230.00    115615.41 1199.11 114416.30
231.00    114988.38 1199.11 113789.27
232.00    114358.22 1199.11 113159.11
233.00    113724.90 1199.11 112525.79
234.00    113088.42 1199.11 111889.31
235.00    112448.76 1199.11 111249.65
236.00    111805.90 1199.11 110606.79
237.00    111159.82 1199.11 109960.71
238.00    110510.52 1199.11 109311.41
239.00    109857.96 1199.11 108658.85
240.00    109202.15 1199.11 108003.04
241.00    108543.05 1199.11 107343.94
242.00    107880.66 1199.11 106681.55
243.00    107214.96 1199.11 106015.85
244.00    106545.93 1199.11 105346.82
245.00    105873.55 1199.11 104674.44
246.00    105197.82 1199.11 103998.71
247.00    104518.70 1199.11 103319.59
248.00    103836.19 1199.11 102637.08
249.00    103150.26 1199.11 101951.15
250.00    102460.91 1199.11 101261.80
251.00    101768.11 1199.11 100569.00
252.00    101071.84 1199.11 99872.73
253.00    100372.10 1199.11 99172.99
254.00     99668.85 1199.11 98469.74
255.00     98962.09 1199.11 97762.98
256.00     98251.79 1199.11 97052.68
257.00     97537.95 1199.11 96338.84
258.00     96820.53 1199.11 95621.42
259.00     96099.53 1199.11 94900.42
260.00     95374.92 1199.11 94175.81
261.00     94646.69 1199.11 93447.58
262.00     93914.82 1199.11 92715.71
263.00     93179.29 1199.11 91980.18
264.00     92440.08 1199.11 91240.97
265.00     91697.17 1199.11 90498.06
266.00     90950.55 1199.11 89751.44
267.00     90200.20 1199.11 89001.09
268.00     89446.10 1199.11 88246.99
269.00     88688.22 1199.11 87489.11
270.00     87926.56 1199.11 86727.45
271.00     87161.08 1199.11 85961.97
272.00     86391.78 1199.11 85192.67
273.00     85618.64 1199.11 84419.53
274.00     84841.62 1199.11 83642.51
275.00     84060.73 1199.11 82861.62
276.00     83275.92 1199.11 82076.81
277.00     82487.20 1199.11 81288.09
278.00     81694.53 1199.11 80495.42
279.00     80897.90 1199.11 79698.79
280.00     80097.28 1199.11 78898.17
281.00     79292.66 1199.11 78093.55
282.00     78484.02 1199.11 77284.91
283.00     77671.33 1199.11 76472.22
284.00     76854.58 1199.11 75655.47
285.00     76033.75 1199.11 74834.64
286.00     75208.82 1199.11 74009.71
287.00     74379.75 1199.11 73180.64
288.00     73546.55 1199.11 72347.44
289.00     72709.17 1199.11 71510.06
290.00     71867.61 1199.11 70668.50
291.00     71021.85 1199.11 69822.74
292.00     70171.85 1199.11 68972.74
293.00     69317.60 1199.11 68118.49
294.00     68459.09 1199.11 67259.98
295.00     67596.28 1199.11 66397.17
296.00     66729.15 1199.11 65530.04
297.00     65857.69 1199.11 64658.58
298.00     64981.88 1199.11 63782.77
299.00     64101.68 1199.11 62902.57
300.00     63217.08 1199.11 62017.97
301.00     62328.06 1199.11 61128.95
302.00     61434.60 1199.11 60235.49
303.00     60536.66 1199.11 59337.55
304.00     59634.24 1199.11 58435.13
305.00     58727.31 1199.11 57528.20
306.00     57815.84 1199.11 56616.73
307.00     56899.81 1199.11 55700.70
308.00     55979.21 1199.11 54780.10
309.00     55054.00 1199.11 53854.89
310.00     54124.16 1199.11 52925.05
311.00     53189.68 1199.11 51990.57
312.00     52250.52 1199.11 51051.41
313.00     51306.67 1199.11 50107.56
314.00     50358.09 1199.11 49158.98
315.00     49404.78 1199.11 48205.67
316.00     48446.70 1199.11 47247.59
317.00     47483.82 1199.11 46284.71
318.00     46516.14 1199.11 45317.03
319.00     45543.61 1199.11 44344.50
320.00     44566.23 1199.11 43367.12
321.00     43583.95 1199.11 42384.84
322.00     42596.77 1199.11 41397.66
323.00     41604.64 1199.11 40405.53
324.00     40607.56 1199.11 39408.45
325.00     39605.49 1199.11 38406.38
326.00     38598.42 1199.11 37399.31
327.00     37586.30 1199.11 36387.19
328.00     36569.13 1199.11 35370.02
329.00     35546.87 1199.11 34347.76
330.00     34519.50 1199.11 33320.39
331.00     33486.99 1199.11 32287.88
332.00     32449.32 1199.11 31250.21
333.00     31406.46 1199.11 30207.35
334.00     30358.39 1199.11 29159.28
335.00     29305.07 1199.11 28105.96
336.00     28246.49 1199.11 27047.38
337.00     27182.62 1199.11 25983.51
338.00     26113.43 1199.11 24914.32
339.00     25038.89 1199.11 23839.78
340.00     23958.98 1199.11 22759.87
341.00     22873.67 1199.11 21674.56
342.00     21782.93 1199.11 20583.82
343.00     20686.74 1199.11 19487.63
344.00     19585.07 1199.11 18385.96
345.00     18477.89 1199.11 17278.78
346.00     17365.17 1199.11 16166.06
347.00     16246.89 1199.11 15047.78
348.00     15123.02 1199.11 13923.91
349.00     13993.53 1199.11 12794.42
350.00     12858.39 1199.11 11659.28
351.00     11717.58 1199.11 10518.47
352.00     10571.06 1199.11 9371.95
353.00      9418.81 1199.11 8219.70
354.00      8260.80 1199.11 7061.69
355.00      7097.00 1199.11 5897.89
356.00      5927.38 1199.11 4728.27
357.00      4751.91 1199.11 3552.80
358.00      3570.56 1199.11 2371.45
359.00      2383.31 1199.11 1184.20
360.00      1190.12 1199.11 -8.99

Final balance amount to be refunded is: 8.990103>>

% please change the payment value for the other problem in the code

I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199
I need help with these two questions 4.12 and 4.13 dealing with MATLAB. Thank you in advance. Solutionclear all; bigBal=2*10^5; endBal=bigBal; i=1; payment=1199

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site