title: Divide a matrix and its corresponding vector into submatrices and subvectors in MATLAB
body: <p>I have two matrices X <code>(122 x 125973)</code> and Y <code>(1 x 125973)</code>. I want to split <strong>in the same way</strong> X and Y  into smaller matrices and vectors of 122 x 1024 (column division) in Matlab.</p>
  
  <p>I have tried several methods (mat2cell, loops, etc), but I think I am missing the syntax. Any help ?</p>
  
  <p><strong>Note:</strong> 125973 can't be divided by 1024, so the last matrix (and vector) will the have the size of <code>(122 x 21)</code> (and <code>(1 x 21)</code> respectively). Thank you for your help!</p>