title: Error using legappend()
body: <p>I am writing a function that iterates through a loop and adds entries to a plot. When I try to use <code>legappend()</code>, though, I get the error below. I am passing it a string variable.</p>
  
  <pre><code>Error using legend&gt;process_inputs (line 526)
  Invalid argument. Type 'help legend' for more information.
  
  Error in legend&gt;make_legend (line 303)
  [orient,location,position,children,listen,strings,propargs] =
  process_inputs(ha,argin); %#ok
  
  Error in legend (line 257)
      [~,msg] = make_legend(ha,args(arg:end),version);
  
  Error in legappend (line 74)
      [legend_h,object_h,plot_h,text_strings] = legend(h,allDatah,str);
  </code></pre>
  
  <p>Here is a minimal example, taken from the <a href="https://www.mathworks.com/examples/matlab/community/11255-legappend" rel="nofollow">MATLAB site</a></p>
  
  <pre><code>% Some data and old models:
  x = (1:10)';
  y = [x-5+x.^1.05 x-2 x-3 x-4 x-5];
  
  % Plot the data and old models:
  figure
  plot(x,y(:,1),'mo','markersize',10);
  hold on;
  plot(x,y(:,2),'r');
  plot(x,y(:,3),'b');
  plot(x,y(:,4),'k');
  plot(x,y(:,5),'kp');
  box off
  axis([1 10 -5 20])
  
  legend('data','model 1','model 2','model 3','model 4','location','northwest')
  legend boxoff
  
  myNewModel = x - 5.5 + x.^1.1;
  plot(x,myNewModel,'m','linewidth',2);
  
  legappend('my new amazing model!')
  </code></pre>