I want to build a 2-D array with the same 1-D array. To say:
1-D array: [1 2 3 4 5 6]
to build a 2-D array like [1 2 3 4 5 6; 1 2 3 4 5 6; 1 2 3 4 5 6; 1 2 3 4 5 6; …; 1 2 3 4 5 6;]
The total number of rows is determined by me. Is there any easy functions to implement to achieve this instead of using for loop?
Best Answer