view projectData.m @ 6:6d94b2bafcd1 default tip

Replace complicated memory-intensive operation with a faster loop
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 06 Dec 2011 11:49:32 -0500
parents 069653867b3b
children
line wrap: on
line source

function Z = projectData(X, U, K)
  ##PROJECTDATA Computes the reduced data representation when projecting only 
  ##on to the top k eigenvectors
  ##   Z = projectData(X, U, K) computes the projection of 
  ##   the normalized inputs X into the reduced dimensional space spanned by
  ##   the first K columns of U. It returns the projected examples in Z.
  ##

  Z = X*U(:,1:K);

end