hi Renuyan
yes, MATLAB has repmat
you set the amount of repetitions
to replicate vertically:
repmat(A,reps,1)=
1.00 2.00 3.00 4.00 5.00 6.00
1.00 2.00 3.00 4.00 5.00 6.00
1.00 2.00 3.00 4.00 5.00 6.00
1.00 2.00 3.00 4.00 5.00 6.00
1.00 2.00 3.00 4.00 5.00 6.00
replicating horizontally:
repmat(A,1,reps)=
Columns 1 through 7
1.00 2.00 3.00 4.00 5.00 6.00 1.00
Columns 8 through 14
2.00 3.00 4.00 5.00 6.00 1.00 2.00
Columns 15 through 21
3.00 4.00 5.00 6.00 1.00 2.00 3.00
Columns 22 through 28
4.00 5.00 6.00 1.00 2.00 3.00 4.00
Columns 29 through 30
5.00 6.00
so far the answer, but in similar exercises you may find also useful the command reshape. Let's say you want to stack A, either
A'
A'=
1.00
2.00
3.00
4.00
5.00
6.00
or
reshape(A,[6,1]) =
1.00
2.00
3.00
4.00
5.00
6.00
If you find this answer of any help solving your question, please click on the thumbs-up vote link,
thanks in advance
John
Best Answer