From: Kalani on
I'm totally new to Matlab and trying to do facial expression recognition in Matlab. I have my feature points written into a .mat file. I tried to adapt the given Matlab SVM code for my task. My mat file('KANEW') has a variable called 'N' with landmark points of a person's different expressions and a it also contains a variable called 'expressions' where every row of feature points is mapped to a file. The feature points of the test image is called 'new'. For the time being I'm only taking 4 columns for comparison.

load KANEW
data = [N(:,1), N(:,2),N(:,3), N(:,4)];
[train]=data;
test=[new(:,1), new(:,2),new(:,3), new(:,4)];
groups = ismember(expressions,'Happy');
cp = classperf(groups);
svmStruct = svmtrain(train,groups);
svmtrain(train,groups)
classes = svmclassify(svmStruct,test);

But I only get a value of 0 when I print the value of classes. And for
classperf(cp,classes,test);
cp.CorrectRate

I get an error message saying

??? Error using ==> classperf at 290
Index vector has invalid values.

Any kind of help or ideas to proceed with this is really appreciated.
Thanks and Regards,
Kalani