Computers and Technology

Write a function called maxproduct that takes a matrix a and a positive integer scalar n as inputs and computes the largest product of n adjacent elements in the same direction in that is, we are looking for products of consecutive elements in the same row, column, diagonal or reverse diagonal. the function must return an n-by-2 matrix containing the row and column indexes ordered first by row and then by column. if no such product exists, the function returns the empty array. for example, valid outputs for a max product of 3 neighbors in four different matrices might be 12 2; 2 3; 2 4] or [1 1; 2 1; 3 1]or 13 5; 44; 5 3] or [4 2; 53; 64]. if there are multiple products with the same maximum value, return the first one you find. (inspired by project euler.)

answer
Answers: 2

Similar questions

Do you know the correct answer?
Write a function called maxproduct that takes a matrix a and a positive integer scalar n as inputs a...

Questions in other subjects:

Konu
Mathematics, 05.11.2020 21:10
Konu
Mathematics, 05.11.2020 21:10
Konu
Mathematics, 05.11.2020 21:10