MATLAB: Concatenating matrix with itself x number of times loopmatrixmatrix manipulation I have t=[1 0 0;0 1 0; 0 0 1] size(t) is (3 3) i need to make t with size of (x,3) where x is user input while element in t are repeated eg if x=2 then t=[t;t] if x=3 then t=[t;t;t] Best Answer Hi,use the function repmat:repmat(t, x, 1)Titus Related SolutionsMATLAB: Matrix dimesions must agree. The number of the elements in t and a must be equal. It appears you meant to writet = 0:5:50; MATLAB: Concatenate This makes the 5x3 that you requested.c1 = {'hello' 'world' 'Happy Tuesday'};c2 = {'Need' 'coffee' 'now'};m1 = magic(3);C = vertcat(c1,c2,num2cell(m1));To make a 3x5 use;C = horzcat(c1',c2',num2cell(m1)); Related QuestionIncorrect dimensions for matrix multiplication.ConcatenateMatrix Manipulation code helpConcatenate arrays
Best Answer