Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
line = rand (1, 1310) *100;
center_of_masscenterOfMass ( line )

c)

Code Block
function [centerxcenterX,centery centerY] = center_Of_Mass2D(mat)
icenterOfMass2d(matrix)
[rows, cols] = 1size(matrix);
for linei = mat1:rows
    centeryVec(i) = center_Of_Mass ( line );
    i = i+1;
end
centerx = sum(center)/length(center);
center = 0;
sum(matrix(i, :));
end
centerY = centerOfMass(yVec);
for i = 1;:cols
for line = mat'
    center xVec(i) = center_Of_Mass ( line );
    i = i+1;
end
centery = sum(center)/length(centersum(matrix(:, i));
end
centerX = centerOfMass(xVec);
end