Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

matlab Tu.png Phetos search Uocurentat on Lug n Bin b View all photos +60% 2. (5

ID: 3860988 • Letter: M

Question

matlab Tu.png Phetos search Uocurentat on Lug n Bin b View all photos +60% 2. (50 points) Centar of mas If the mass and the location of the center of mass, C, (with respect MATLAB to a common origin) for different parts of an object are knoam, the center of mass can be easily calculated usinga weighted average Refer to the diagram on the following page for the definitions below . m, is the mass of part i . C is the center of mass foe part i . x is the x-coordinate of the center of mass for part i gle Name Value Use topen to ganerate file oxd forrnat mr is the mass of the entire object .Cr is the center of mass for the entire object Xr is the x coordinate of the center of mass for the entire object. a integer-valed w ILAB 35 Mozill irefox CE Suppx usist1 35 Example If the object illastrated above has the folloaing values for x and m,find the total mass, m, and the location of the center of mass, presentatin L00 102 PM 7/26/2017

Explanation / Answer

clear
clc
data=load('newfile.txt');
x=data(:,1);
mass=data(:,2);
Center_Of_Mass=(sum(x.*mass))/(sum(mass));
Total_mass=sum(mass);
fprintf('Center of Mass=%f mm,Total Mass=%.2f g ',Center_Of_Mass,Total_mass);