title: Classifying data based on a training set
body: <p>I have some data that needs classifying. I've tried to use the classify function <a href="http://www.mathworks.co.uk/help/stats/classify.html" rel="nofollow">described here</a>. </p>
  
  <p>My sample is a matrix that has 1 column and 382 rows. </p>
  
  <p>My training is a matrix with 1 column and 2 rows.</p>
  
  <p>Grouping is causing me the issues. I've written: <code>grouping = [a,b];</code> where a is one category and b is another.</p>
  
  <p>This gives me the error: </p>
  
  <pre><code>Undefined function or variable 'a'.
  Error in discrimtrialab (line 89) 
  grouping = [a,b];
  </code></pre>
  
  <p>Further to this, how do I classify a group, ie. not just the exact value in training?</p>
  
  <p>Here is my code:  </p>
  
  <pre><code>a = -0.09306:0.0001:0.00476;
  b = -0.02968:0.0001:0.01484;
  
  %training = groups (odour index)
  
  training = [-0.09306:0.00476; -0.02968:0.01484;];
  
  %grouping variable
  
  group = [a,b]
  
  %classify
  
   [class, err]  = classify(sample, training, group, 'linear');
  
   class(a)
  </code></pre>
  
  <p>(note - there is some processing above this, but it is irrelevant to the question) </p>