[ignore,maxind] = max(abs(U),[],1);
negloc = (U(maxind + (0:N_f:(N_f-1)*N_f)) < 0);
U(:,negloc) = -U(:,negloc);
(N_f is the number of columns in the matrix (actually the number of rows, but it is a square matrix, so same-same))
I am assuming that these two line multiply all the...