function U = matrixstacker(A,m,n)
% matrixstacker.m
% Puts m A-matrices in U, the A-matrices overlaps each other with n columns
%     | A         |
%     |   A       |
% U = |     .     |
%     |       .   |
%     |         A |
% Written by: Martin Kvernland
U = zeros(size(A,1) * m,size(A,2) * m - (m - 1) * n);
col = 1;
row = 1;
for i = 1:m
    U(row:row + size(A,1) - 1,col:col + size(A,2) - 1) = A;
    row = row + size(A,1);
    col = col + size(A,2) - n;
end