
% Matrix with rankings:
A = [2 2 -2 -2; 2 2 -2 -2; -2 -2 2 2; -2 -2 2 2];

% add another row:
B = [A; 0 0 2 0];

disp('Matrix of ratings:')
B

[U,S,V] = svd(B);

B1 = U(:,1)*S(1,1)*V(:,1)';

disp('Rank 1 approximation:')
B1

