Versions Compared

Key

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

...

Code Block
function [centerx,centery] = center_Of_Mass2D(mat)
i = 1;
for line = mat
    center(i) = center_ofOf_massMass ( line );
    i = i+1;
end
centerx = sum(center)/length(center);
center = 0;
i = 1;
for line = mat'
    center(i) = center_ofOf_massMass ( line );
    i = i+1;
end
centery = sum(center)/length(center);
end