I need to code vectors given in pdf file.. xcoords=[1 7 6 8 3 5 9 2 8 6 2 4 1];
ID: 1860564 • Letter: I
Question
I need to code vectors given in pdf file..
xcoords=[1 7 6 8 3 5 9 2 8 6 2 4 1];
ycoords=[8 3 7 5 9 1 3 6 8 8 2 3 4];
masses=[11 8 10 4 5 11 6 7 12 8 9 6 5];
plot(xcoords, ycoords, 'b-*')
xlabel('x-axis')
ylabel('y-axis')
title('center of mass')
xcenter=(mean(masses)*mean(xcoords))/mean(masses);
ycenter=(mean(masses)*mean(ycoords))/mean(masses);
hold on
plot(xcenter, ycenter, 'g--+')
hold off
Here is the code that I've done but can't figure it out further..
% coordinates and masses of particles xcoords =[1 7 6 8 3 5 9 2 8 6 2 4 1]; ycoords =[8 3 7 5 9 1 3 6 8 8 2 3 4]; masses = [11 8 10 4 5 11 6 7 12 8 9 6 5]; % calculate the center of mass of the particles xcenter = ycenter = % print center of mass coordinates using dispExplanation / Answer
xcoords=[1 7 6 8 3 5 9 2 8 6 2 4 1];
ycoords=[8 3 7 5 9 1 3 6 8 8 2 3 4];
masses=[11 8 10 4 5 11 6 7 12 8 9 6 5];
plot(xcoords, ycoords, 'b-*')
xlabel('x-axis')
ylabel('y-axis')
title('center of mass')
xcenter=(mean(masses)*mean(xcoords))/mean(masses);
ycenter=(mean(masses)*mean(ycoords))/mean(masses);
hold on
plot(xcenter, ycenter, 'g--+')
hold off
p = [xcenter ycenter]
disp(p)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.