Exercise 5 (25 Marks)
Write a program called Sums.m which reads a text file consisting of a matrix ofcomma separated numbers, appends the sum (i.e., add the summation of allelements at the end) to each row and each column and rewrites the (tabulated)numbers back to another file. It should be possible for the user to select the nameof this new file when the program is running. If the input file is as follows (create atext file using Notepad and put the numbers below on it and save it):3.4,27,53,1.2
6.3,7.9,52,04
7.1,8.0,23,4.9
Then the output produced should be:
3.400000, 2.700000, 5.300000, 1.200000, 12.600000
6.300000, 7.900000, 5.200000, 0.400000, 19.800000
7.100000, 8.000000, 2.300000, 4.900000, 22.300000
16.800000, 18.600000, 12.800000, 6.500000
#Sales Offer!| Get upto 25% Off: