MATLAB: Problem for creating vector with for loop

for loop

a={'w','c','e'};
%I wanna create 2 times of w,c,e, with using for loop, like this
aa={'w','w','c','c','e','e'};

Best Answer

a={'w','c','e'};
nRep = 5;
your_mat = reshape(repmat(a,nRep,1),1,[]);