Question: Function Description: You will be given an array of numbers representing the likelihood that a pokemon can be found in a certain region. Return a

 Function Description: You will be given an array of numbers representing

Function Description: You will be given an array of numbers representing the likelihood that a pokemon can be found in a certain region. Return a new array where each element is the average of the value from the old array and its eight surrounding neighbors. Since edges and corners do not have eight neighbors, they are deleted from the new array. A trivial example is as follows: [ 24 2; 4 3 4; 2.4 2] [3] Example: >> oldMap = [4 5 3 10; 5 0 1 7; 5 6 9 11; 9 8 2 22]; >> updatedMap = pokeMigration (oldMap) >> updatedMap [4.22 5.78; 5.00 7.33] Notes: Round the updated array to 2 decimal places. The initial array is guaranteed to be at least 3x3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!