Home:ALL Converter>DolphinDB: create a large matrix with repeat copies of matrix A

DolphinDB: create a large matrix with repeat copies of matrix A

Ask Time:2020-12-31T14:34:56         Author:dylanlu

Json Formatter

What should I do if I want to repeat copies of a matrix into a 2-by-2 block arrangement?

For example:

A=1..4$2:2

#0 #1
-- --
1  3 
2  4 

I need to repeat it n times, the matrix should be

#0 #1 #2 #3
-- -- -- --
1  3  1  3 
2  4  2  4 
1  3  1  3 
2  4  2  4 

Any idea how to accomplish this without using loop?

Author:dylanlu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65517453/dolphindb-create-a-large-matrix-with-repeat-copies-of-matrix-a
yy