function A = slicemh(A, numSlices)
  % ========================
  % https://guiard.org/pages/octave/slicem.html
  % =========================
  %
  % Slice matrix A horizontally in numSlices parts and append parts vertically
  % Version 1.00

  ##  Example
  ##
  ##  A =
  ##
  ##      1    3  |  5    7  |  9   11
  ##      2    4  |  6    8  | 10   12
  ##      
  ##  numSlices = 3
  ##
  ##  ans =
  ##
  ##      1    3
  ##      2    4
  ##      ------
  ##      5    7
  ##      6    8
  ##      ------
  ##      9   11
  ##     10   12 
  ##
   

  cA = columns(A);
  rA = rows(A);


  if mod(cA,numSlices) == 0

    A = reshape(A,rA,cA/numSlices, numSlices);

    A = rotdim (A, 1, [2, 3]);

    A = fliplr (A);

    A = reshape(A,rA*numSlices,cA/numSlices);

  endif

  
endfunction
