Download this file
1 2 3 4 5 6
function [centered_data,centroid] = CenterRowData(input) % each row is a data point centroid = mean(input); centered_data = input-(ones(size(input, 1), 1)*centroid);