idamnjanovic@60: function y = normcols(x) idamnjanovic@60: %NORMCOLS Normalize matrix columns. idamnjanovic@60: % Y = NORMCOLS(X) normalizes the columns of X to unit length, returning idamnjanovic@60: % the result as Y. idamnjanovic@60: % idamnjanovic@60: % See also ADDTOCOLS. idamnjanovic@60: idamnjanovic@60: idamnjanovic@60: % Ron Rubinstein idamnjanovic@60: % Computer Science Department idamnjanovic@60: % Technion, Haifa 32000 Israel idamnjanovic@60: % ronrubin@cs idamnjanovic@60: % idamnjanovic@60: % April 2009 idamnjanovic@60: idamnjanovic@60: idamnjanovic@60: y = x*spdiag(1./sqrt(sum(x.*x)));