Could you help me please to repeat matrix. for example if I have matrix(A) and I want to create a big matrix(B) contains three matrices of matrix(A) in the row and two matrices in the column.
Asked
Active
Viewed 144 times
-3
-
Check `repmat`. That should do exactly what you want. – Nemesis Nov 06 '14 at 10:18
-
1Note that the a quick google for *Matlab How can I repeat matrix* gives the answer to this as the top result. Please try to solve the problem yourself before asking others. – Dennis Jaheruddin Nov 06 '14 at 10:38
2 Answers
1
In MatLab, you want to use repmat()
.
In Python, use the Numpy function, tile(a, (m, n))
.
You should check out this post: https://stackoverflow.com/a/1724410/515559
-
Upvoted as you did provide the right answer, but would recommend you to avoid information that is not directly relevant. (An explanation of how to do it in Python, whilst the asker asks about Matlab). It can be a bit distracting. – Dennis Jaheruddin Nov 06 '14 at 10:41
-
1
The MATLAB function repmat
does exactly what you need:
B = repmat(A,3,2);
For more details see the MATLAB documentation

hbaderts
- 14,136
- 4
- 41
- 48