Generating the matrix of output codes is one of the most effective methods to reduce multiclass to binary. How to establish the effect of coding matrix is the key to solve this problem. Therefore, the ??-nearest neighbor classifying error rateis taken as a metewand, which can translate construction issue into searching problem. The matrix of standard output codes is generated by using ? binary partitions based on row-exchange rule and limited heuristic search strategy in the space of ?? classes. Experimental results on artificial data and UCI with logistic linear classifier(loglc) and support vector machine(SVM) as the binary learner show that the proposed method has better performance of classification with shorter length of coding matrix.