Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me with this Matlab code? Thank you. 2. The center of mass of a collections of N particles is given by: N
Can someone help me with this Matlab code? Thank you.
2. The center of mass of a collections of N particles is given by: N 1 rcm = miri, M i=1 where M = 8:21 Mi is the total mass of the particles being considered, and r; is the position of the ith particle. a) Write a m-file that computes the center of mass of a collection of particles, test it for the next case: N = 5, r : (2, 2.1), r2 = (-1, 1.2), r3 = (0, -0.5), r4 = (1,0.8) and r5 = (1.3, 1.7). Consider all masses being the same and equal to 1. The code should also plot particle positions. b) Write a Matlab function that generates the positions of N particles at random, in the area [-2, 2] * [-1,1] (use the built-in function rand). c) By using N = 1000, compute the center of mass of all particles in b), that are located at [0, 1] [0, 1]. Plot the particle positionsStep 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