title: Subscript indices must either be real positive integers or logicals in svmclassify matlab
body: <p>I am using the matlab's svm classify function. My train and test data have the following dimensions: </p>
  
  <pre><code>&gt;&gt; size(TrainV)
  
  ans =  
  
     99192         705
  
  &gt;&gt; size(TestV)
  
  ans =
  
  246   705
  </code></pre>
  
  <p>I have a function that trains a one-versus-one classify with 10 classes (45 binary classifiers). The model can be trained by calling the function below:</p>
  
  <pre><code>Models = SVM_multitrain (TrainV(:, 2:end), TrainV(:, 1), 10); 
  </code></pre>
  
  <p>I am sending the feature vectors (TrainV(:, 2:end)) and the labels (TrainV(:, 1)) and I am asking the Models to train the combination of couples for 45 classifiers (10). The function runs ok and I can have the following information after the training. For example, I will show the models for the 3rd and 45th binary classifiers.</p>
  
  <pre><code>&gt; Models(3)
  
  ans = 
  
        SupportVectors: [9x704 double]
                 Alpha: [9x1 double]
                  Bias: -2.3927 - 0.0001i
        KernelFunction: @linear_kernel
    KernelFunctionArgs: {}
            GroupNames: [20117x1 double]
  SupportVectorIndices: [9x1 double]
             ScaleData: [1x1 struct]
         FigureHandles: []
  
  &gt;&gt; Models(45)
  
  ans = 
  
        SupportVectors: [10x704 double]
                 Alpha: [10x1 double]
                  Bias: -2.7245 + 0.0000i
        KernelFunction: @linear_kernel
    KernelFunctionArgs: {}
            GroupNames: [22087x1 double]
  SupportVectorIndices: [10x1 double]
             ScaleData: [1x1 struct]
         FigureHandles: []
  </code></pre>
  
  <p>The problem is when I call the function to classify a feature vector, for example, for the first binary classifier.</p>
  
  <pre><code>&gt;&gt;         TestAttribBin = svmclassify(Models(1), TestV(:,2:end))
  Subscript indices must either be real positive integers or logicals.
  
  Error in svmclassify (line 140)
  outclass = glevels(outclass(~unClassified),:);
  </code></pre>
  
  <p>What could be the problem? when I apply the same classification procedure to feature vectors extracted in another way this problem does not happen.</p>