Are you trying to implement the classification training with two classes? Your label = [ones(size(C2res{1},2),1)];
contains only one value, and it seems to be expected two values (as two categories). I think that's the reason the error comes out.
If you are applying one-class SVM, try to add such option (see this page for more references on the option):
SVMStruct = svmtrain(XTrain , label,'-t 0 -s 2');