Question: IN MATLAB PLEASE!!! Write a function f indCenter0fMass () that takes in a 2D array called foodPos, and outputs a two-element array called center. foodPos
IN MATLAB PLEASE!!!
Write a function f indCenter0fMass () that takes in a 2D array called foodPos, and outputs a two-element array called center. foodPos has N rows and 2 columns. Each row represents the position of a separate food particle, with the first column representing the x-position of each particle and the second column representing the y-position of each particle. center should have 1 row and 2 columns. The first element contains the x position of the center of mass of all of the food particles, while the second element contains the y position of the center of mass. Assume that all particles have the same mass. Write a script to test your function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
