MATLAB: Calculate the Center of Gravity

center of gravity matrix class

Example with 3 classes and 3 variables : It is assumed that there was three quantitative variables noted Y1, Y2, Y3 and a quantitative variable T to K = 3 terms on a sample of seven individuals. The results obtained are as follows:
How can i calculate the Center of Gravity of every class ???
suppose that we have a matrix M

Best Answer

Center of gravity with respect to individus(i) or with respect to ti?
Regardless, it's
cog = sum(x .* y) / sum(y);
where x is either the individus(i) array or the ti array.