Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started