Given a vector x = [3, 1, 4] and integer number n = 5, create matrix y containing n-times x(1) in 1st Row , n-times x(2) in 2nd Row and so on….then covert this matrix into row vector V.

Given a vector x = [3, 1, 4] and integer number n = 5, create matrix y containing n-times x(1) in 1st Row , n-times x(2) in 2nd Row and so on….then covert this matrix into row vector V.

Solution:

x=[3 1 4] n=5 y=x' y= horzcat(x',x',x',x',x') y=[y(1,:) y(2,:) y(3,:)]










 

Comments