Find the center of gravity of an array

COG returns the coordinates of the center of gravity, in each dimension.

You are now following this Submission

This function returns the coordinates of a vector, a matrix or a multi-dimensional array.
The coordinates can be defined by the user, or represent the location of the element in the matrix.

Cite As

Noam Greenboim (2026). Find the center of gravity of an array (https://www.mathworks.com/matlabcentral/fileexchange/48451-find-the-center-of-gravity-of-an-array), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

A typo under "summary" was corrected

1.0.0.0