title: matlab: grouping variables for gscatter
body: <p>I'm a complete Matlab newbie, so please bear with me :) I'm using my friend's vague instructions, so I don't if they are correct.</p>
  
  <p>I have variable named m12 (imported form an .xls file), which is an 61x3 array. No labels.</p>
  
  <p>The first column contains leverages, the second standardised residuals for the training (first 46 rows) and validation (remaining 15 rows) sets of a PLS model.</p>
  
  <p>I want to group those first two columns, so that the training set is represented by blue 'X', and validation set by red 'O', so I put 46 rows of '1's and next 15 rows '2's in the third column.</p>
  
  <p>My friend told me to simply type:</p>
  
  <blockquote>
    <p>group(:,3)</p>
    
    <p>gscatter(m12(:,1), m12(:,2), group,
    'br', 'xo')</p>
  </blockquote>
  
  <p>but when I type</p>
  
  <pre><code> group(:,3)
  </code></pre>
  
  <p>I get an "??? Undefined variable group." error.</p>
  
  <p>Can anyone help me?</p>