title: Resizing a 3D matrix into a 2D matrix in MATLAB
body: <p>I have the following three-dimensional matrix <code>X</code> of size <code>2*2*3</code>:</p>
  <pre><code>X = zeros(2, 2, 3);
  X(:,:,1) = [1 2; 3 4];
  X(:,:,2) = [5 6; 7 8];
  X(:,:,3) = [9 10; 11 12];
  </code></pre>
  <p>I want to automatically reshape <code>X</code> to a two-dimensional matrix of size <code>6*2</code> such that I should obtain:</p>
  <p><code>X_reshaped = [1 2; 3 4; 5 6; 7 8; 9 10; 11 12]</code>.</p>
  <p>In MATLAB, I am trying to write <code>X_reshaped = reshape(X, [size(X,1)*size(X,3), size(X,2)])</code>, but this doesn't give me the desired <code>X_reshaped</code> as above.</p>
  <p>Any help will be very appreciated!</p>