title: Matlab : Plot each line of a matrix as a function of its index
body: <p>I would like to create a plot with several lines, each corresponding to a row at a given matrix.</p>
  
  <p>To be more elaborate, I have got a matrix <em>M</em> where each row represents a value that is changing along the columns. I would like to plot this change as a function of the column index to each of the rows, so to plot (e.g) the first rowI should :</p>
  
  <pre><code>plot(M(1,:));
  </code></pre>
  
  <p>The thing is, I would like to plot <em>all</em> the rows. Of course I could iterate over them, <a href="http://www.mathworks.com/help/matlab/ref/hold.html" rel="nofollow">hold</a> and plot the current one:</p>
  
  <pre><code>(plot(M(i,:))
  </code></pre>
  
  <p>but I'm wondering if there's a simple command or a single-liner that would do it.</p>
  
  <p>I have tried <a href="http://www.mathworks.com/help/matlab/ref/plotmatrix.html" rel="nofollow">plotmatrix</a> but without much success regarding the desirable results.</p>
  
  <p>Thanks!</p>