title: How can I add a cell array of strings in a legend in Matlab?
body: <p>I'm trying to use a cell array of strings in order to build a legend for each sample in a graph, something like this:</p>
  
  <pre><code>x = [1 5 3 5 6];
  y = [3 6 3 6 4];
  Legend = cell(5,1);
  Legend{1} = 'a';
  Legend{2} = 'b';
  Legend{3} = 'c';
  Legend{4} = 'd';
  Legend{5} = 'e';
  figure
  hold on
  for k=1:5
      plot(x(k),y(k),'o')
  end
  legend(Legend)
  </code></pre>
  
  <p>But I'm getting the following message error from matlab:</p>
  
  <pre><code>Error using subsindex
  Function 'subsindex' is not defined for values of class 'cell'.
  </code></pre>
  
  <p>Is there something that I can do to fix it?</p>
  
  <p>Thanks</p>