Fixed bug with generateKMeansDatabase.m