% Simple method to compute the weighted means of each column: 


[m,n] = size(x);

for col = 1:n
    sum_weight = 0;
    sum_x = 0;

    for row = 1:m
        weight = row; 
        sum_weight = sum_weight + weight;
        sum_x = sum_x + weight * x(row, col);
    end

    mean_x = sum_x / sum_weight 
end