I understood the problem itself, but I’m having some issues withthe code. Please answer in python lenguage, I willrate and appreciate your time and help with this problem. Thanksand have a nice day/night.
P#1. Scanning Temperatures. In a ‘toy’ 5×5 temperature submatrix, located within a larger matrix, let’s focus in some neighboring temperatures. The main idea is to search for 5-neighboring temperatures and located the largest sum. The directions of interest are: 185 (1) Temperatures along rows: (2) Along columns (3) Along main diagonals (4) Along antidiagonals 304 81 95 50 22 37 7- 309 26 85 54 786 24 -28 2381 —3—–48—–23 —–76—-52- 62 23Page 9 299 (5) Along X-shape groups Using the numbers above, let’s give some examples: (1) The sum of one row is 33+48+23+76+52 = 232 (2) The sum of one column 81+97+85+8+33 = 304 (3) The sum of the diagonal is 81+7+78+81+52 = 299 (4) The sum of the antidiagonal is 33+28+78+9+37 = 185 (5) The sum along a X-shape is 81+7+78+50+85=301 The code for the sum of each item will be developed as a user-defined function and a search within the full 5×5 submatrix will then be attempted by a driver program. Can’t use the user- defined function sum. Before writing your main code (driver program). Open and Save the data which you should save in the file T.m (which is different than the data of the example above). The Driver Code loads the data from the T.m by the load command (or function). Your Driver Code should answer three questions: (a) What is the greatest sum of five adjacent numbers in the 5×5 grid? (b) In what direction is this largest sum located? Row#? Column#? Etc. (c) What is the total sum in the 5×5 grid. Show transcribed image text P#1. Scanning Temperatures. In a ‘toy’ 5×5 temperature submatrix, located within a larger matrix, let’s focus in some neighboring temperatures. The main idea is to search for 5-neighboring temperatures and located the largest sum. The directions of interest are: 185 (1) Temperatures along rows: (2) Along columns (3) Along main diagonals (4) Along antidiagonals 304 81 95 50 22 37 7- 309 26 85 54 786 24 -28 2381 —3—–48—–23 —–76—-52- 62 23Page 9 299
(5) Along X-shape groups Using the numbers above, let’s give some examples: (1) The sum of one row is 33+48+23+76+52 = 232 (2) The sum of one column 81+97+85+8+33 = 304 (3) The sum of the diagonal is 81+7+78+81+52 = 299 (4) The sum of the antidiagonal is 33+28+78+9+37 = 185 (5) The sum along a X-shape is 81+7+78+50+85=301 The code for the sum of each item will be developed as a user-defined function and a search within the full 5×5 submatrix will then be attempted by a driver program. Can’t use the user- defined function sum. Before writing your main code (driver program). Open and Save the data which you should save in the file T.m (which is different than the data of the example above). The Driver Code loads the data from the T.m by the load command (or function). Your Driver Code should answer three questions: (a) What is the greatest sum of five adjacent numbers in the 5×5 grid? (b) In what direction is this largest sum located? Row#? Column#? Etc. (c) What is the total sum in the 5×5 grid.
Expert Answer
Answer to I understood the problem itself, but I’m having some issues with the code. Please answer in python lenguage, I will rat…