title: splitting a Matrix into column vectors and storing it in an array
body: <p>My question has two parts:</p>
  
  <ol>
  <li>Split a given matrix into its columns</li>
  <li>These columns should be stored into an array</li>
  </ol>
  
  <p>eg,</p>
  
  <pre><code>A = [1 3 5 
       3 5 7
       4 5 7
       6 8 9]
  </code></pre>
  
  <p>Now, I know the solution to the first part:</p>
  
  <p>the columns are obtained via 
  <code>tempCol = A(:,iter), where iter = 1:end</code></p>
  
  <p>Regarding the second part of the problem, I would like to have (something like this, maybe a different indexing into arraySplit array), but one full column of A should be stored at a single index in splitArray:</p>
  
  <pre><code>arraySplit(1) = A(:,1)
  arraySplit(2) = A(:,2)
  </code></pre>
  
  <p>and so on...</p>
  
  <p>for the example matrix <code>A</code>,</p>
  
  <p><code>arraySplit(1)</code> should give me  <code>[ 1 3 4 6 ]'</code></p>
  
  <p><code>arraySplit(2)</code> should give me <code>[ 3 5 5 8 ]'</code></p>
  
  <p>I am getting the following error, when i try to assign the column vector to my array.</p>
  
  <pre><code>In an assignment  A(I) = B, the number of elements in B and I must be the same.
  </code></pre>
  
  <p>I am doing the allocation and access of <code>arraySplit</code> wrongly, please help me out ...</p>