title: How to save matrixes as a vector
body: <p>I have a text file that is a matrix 2819x10.
  I have splited it into 5x5x563 matrix using code below</p>
  
  <pre><code>Matrix = dlmread('det.txt');
  for j=1:1:563
  for i=1:1:5
  
  M(i,1,j) = Matrix(temp,3);
  M(i,2,j)= Matrix(temp,4);
  M(i,3,j)= Matrix(temp,5);
  M(i,4,j) = Matrix(temp,6);
  M(i,5,j) = 1;
  temp=temp+1;
  end
  end
  </code></pre>
  
  <p>After this code I have Matrix 5x5x563. Right now I would like to to create a array like is presented bellow, that consist only one row, and each column is my matrix of 5x5. </p>
  
  <p>I have tried with mat2cell:</p>
  
  <pre><code>MatrixNew= mat2cell(M, 5, 5);
  </code></pre>
  
  <p>But I have still an error. I dont have clue how to fix it. I am not try to find a ready code but just advice.
  <img src="https://i.imgur.com/N8p9SU2.png" alt=""></p>
  
  <p>How can I accomplish this?</p>