MATLAB: Multiply numbers in a table numbers multiply Assume the following numbers in a table 1234 How can I multiply them in the following manner: 1111222233334444 thanks Best Answer Try x = [1;2;3;4]; reshape( repmat( transpose(x), [4,1]), [], 1 ) Related SolutionsMATLAB: How can enlarge a matrix If you have MATLAB R2015a (or more recent) then you can use repelem.Otherwise you could try this FEX submission:http://de.mathworks.com/matlabcentral/fileexchange/24536-expandOr else you have to calculate it yourself, the easiest way is to use kron:>> m = [1,2;3,4];>> n = 5;>> kron(m,ones(n))ans = 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 3 3 3 3 3 4 4 4 4 4 3 3 3 3 3 4 4 4 4 4 3 3 3 3 3 4 4 4 4 4 3 3 3 3 3 4 4 4 4 4 MATLAB: From a=[1 2 3 4] to b=[1 1 2 2 3 3 4 4] b = repelem(a,2) Related QuestionHow to multiply each of the array with another set of arrayHow to multiply a vector with each column of a matrixHow to repeat a row by a certain factorHow to genneral a repeat array
Best Answer