Question: Write a MATLAB script that simulates a squirrel randomly foraging for an acorn using a 2D-random walk. The foraging area for the squirrel is a
Write a MATLAB script that simulates a squirrel randomly foraging for an acorn using a 2D-random walk. The foraging area for the squirrel is a 10 x10 square grid (which the squirrel never leaves), with the acorn located in a single cell within the grid. Your script should: 1. Animate the random walk 2. Calculate the total distance travelled before finding the acorn. 3. Determine the average total distance travelled before acorn discovery for 1,000 simulated walks 4. Display a histogram for the total distance travelled before acorn discovery for 1,000 simulated walks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
