%模型训练及数据整理model_12=svmtrain(class_12_label,class_12_value);model_13=svmtrain(class_13_label,class_13_value);model_14=svmtrain(class_14_label,class_14_value);model_23=svmtrain(class_23_label,class_23_value);model_24=svmtrain(class_24_label,class_24_value);model_34=svmtrain(class_34_label,class_34_value);%½øÐÐÔ¤²â[predict_labe1,accuracy_1,dec_values_1]=svmpredict(test_scale_label,test_scale_value,model_12);[predict_labe2,accuracy_2,dec_values_2]=svmpredict(test_scale_label,test_scale_value,model_13);[predict_labe3,accuracy_3,dec_values_3]=svmpredict(test_scale_label,test_scale_value,model_14);[predict_labe4,accuracy_4,dec_values_4]=svmpredict(test_scale_label,test_scale_value,model_23);[predict_labe5,accuracy_5,dec_values_5]=svmpredict(test_scale_label,test_scale_value,model_24);[predict_labe6,accuracy_6,dec_values_6]=svmpredict(test_scale_label,test_scale_value,model_34);predict_labe7=[predict_labe1,predict_labe2,predict_labe3,predict_labe4,predict_labe5,predict_labe6];[m,n]=size(predict_labe7);predict_labe=zeros(m,1);fori=1:mn1=0;n2=0;n3=0;n4=0;forj=1:nifpredict_labe7(i,j)==1n1=n1+1;elseifpredict_labe7(i,j)==2n2=n2+1;elseifpredict_labe7(i,j)==3n3=n3+1;elseifpredict_labe7(i,j)==4n4=n4+1;endendendendendB=[n1n2n3n4];max=B(1,1);predict_labe(i,1)=1;fork=1:3ifmax=B(1,k+1)max=B(1,k+1);predict_labe(i,1)=k+1;endendend%ͳ¼Æ׼ȷÂÊcount=0;forp=1:miftest_scale_label(p,1)==predict_labe(p,1)count=count+1;endendq=count/m;disp([num2str(q*100),'%'])