title: Assigning individual elements in a vector to new variables in matlab
body: <p>Let's just say I have a matrix:</p>
  
  <pre><code>a=[1 2 3;4 5 6;7 8 9]
  </code></pre>
  
  <p>I would like to assign all the elements in the second row to separate variables like:</p>
  
  <pre><code>x=4 y=5 z=6
  </code></pre>
  
  <p>When I type...</p>
  
  <pre><code>[x,y,z] = a(1,:) or [x,y,z] = a(:)
  </code></pre>
  
  <p>...it throws an error message displaying that </p>
  
  <blockquote>
    <p>"Indexing cannot multiple results"</p>
  </blockquote>