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,[]); Related SolutionsMATLAB: How can i find the sorted indexing of the array A = [2 9 6 5 8];n = numel(A);AA = [A;1:n];swapped = 1;while swapped swapped = 0; for ii = 1:n-1 if AA(1,ii+1) > AA(1,ii) memory = AA(:,ii); AA(:,ii) = AA(:,ii+1); AA(:,ii+1) = memory; swapped = 1; end end endAsort = AA(1,:);Index_sort = AA(2,:); MATLAB: Fast way to replicate array w=[1 2; ... 3 4; ... 5 6];N=5;E=size(w,1);F=size(w,2);D=repmat(reshape(w',1,F,1,E),N,1,N,1); Related QuestionMatrix and ForHow to extract element of all matrices within a cell array using cellfunMaybe a colon operatorHow to solve “Index exceeds matrix dimensions” error..Convert a fixed width char array into a column vector
Best Answer