So instead of repmat, which makes 123123123 from 123, I want 111222333. But this is just a simple example with a vector. More precisely I have an MxN matrix, and I want to add noise. I want to make several noisy samples, so for each row, I would like to have K noisy version. Therefore I use its repetited version: B = repmat(A,K,1); and I would like to add noise to this matrix. But to be as representative as possible - for example further integration (marginalization) - I use pre generated noise instead of independent random noise. So let be the representative noise sample be C = [c_1,c_2,...,c_K]. I would like to add noise c_1 to the first, the (K+1)th, (2*K+1)th, etc. row of B, c_2 to the 2nd, (K+2)., ... row of B etc. How to do this simply? And what if I would like to permutate noise not be correlated, so I want to add C to the firts block of B (rows from 1 to K), but I want to add randperm(C) to the second block (rows from K+1 to 2K), etc.