I have a 4x1 matrix,
A= [1;2;3;4]
I want to make B
such that its size is 4x50. All the elements in the columns must contain the same elements of A. For example,
B= [1 1 1 1.... 1 1; 2 2 2 2.... 2 2; 3 3 3 3.... 3 3; 4 4 4 4.... 4 4]
In this case all the elements of A from column 1 is present in the same way in the first column of B, same for second column on B, and so on
Is there any way to form B like this from A? I was trying concatenating like below:
B= horzcat(A,A,...);
But in this case, I have to write A
, 50 times. So is there any other way to get the same result?