title: Correct way of adding to a list from cell array in matlab?
body: <p>I'm writing  some code to split up a 180x2 matlab cell array based on a string in the second column. This string is one of EP,GA,PS,SS or SA. In python I could define empty lists then use conditionals to iterate over the elements of the list and append them to the relevant lists. </p>
  
  <p>The Code</p>
  
  <pre><code>EP=[];
  GA=[];
  PS=[];
  SA=[];
  SS=[];
  for i=1:size(d),
      if strcmp(d(i,2),'EP'),
          append(EP,d(i,1))
      elseif strcmp(d(i,2),'GA'),
          append(GA,i)
      elseif strcmp(d(i,2),'PS'),
          append(PS,i)
      elseif strcmp(d(i,2),'SA'),
          append(SA,i)
      elseif strcmp(d(i,2),'SS'),
          append(SS,i)
      end
  end
  </code></pre>
  
  <p>Note that 'd' is a 180x2 cell array that I copied and pasted into matlab rather than import. The general structure of the data however is:</p>
  
  <pre><code>12.9089000000000    'EP'
  13.3697000000000    'SA'
  13.4335000000000    'EP'
  13.5302000000000    'PS'
  13.8434000000000    'EP'
  14.2583000000000    'EP'
  14.8221000000000    'GA'
  </code></pre>
  
  <p>However when attempting this tactic in matlab I get an error:</p>
  
  <pre><code>Error using append (line 38)
  Wrong number of input arguments for obsolete
  matrix-based syntax.
  
  Error in Boxplot_All_results (line 12)
          append(GA,i)
  </code></pre>
  
  <p>Could somebody tell me the correct way of doing this in matlab</p>