MATLAB: How to generate a matrix with the same vector in all the lines matrix vector n times Hello, I'd like to generate a matrix with the same vector n times. What I can choose. For example: A= [ 1 2 3; 1 2 3; 1 2 3; …..n times……; 1 2 3] Thank You Best Answer A = repmat(1:3,n,1)And to learn more:doc repmat Related SolutionsMATLAB: How to genneral a repeat array You can use repelem function to accomplish your questiona = 1 2 3 4>> repelem(a, 3)ans = 1 1 1 2 2 2 3 3 3 4 4 4 MATLAB: Repeat element of a vector n times without loop. n=3 ; x=(1:3)' % example r=repmat(x,1,n)'; r=r(:)' Related QuestionNeed help in creating matrix…..pleaseReshape 3d to 2d arrayVector Matrix multiplication (Row wise)Create vector of repeating elements (sort of)Repeat a vector with increment
Best Answer