MATLAB: How to extend array extend array I want to extend an array like this: A = [1 2 3 4]; B = [2 3 5 7]; C =[1 1 2 2 2 3 3 3 3 3 4 4 4 4 4 4 4]; How could I do that? Best Answer repelem(A,B) Related SolutionsMATLAB: How to extend/add elements to an array A = [2 3 4 5 0 1 4 5 5 0 3 4 0 2 0 ];B = [3 2 3 5];out = A(sort([find(A),repelem(find(A == 0),B)])); MATLAB: How to create the array [1, 2,2 ,3, 3, 3, 4,4 4, 4] >> V = 1:10;>> floor(sqrt(2*V)+1/2)ans = 1 2 2 3 3 3 4 4 4 4 Related QuestionHow to extend a cell array3 dimension arrayFrom a=[1 2 3 4] to b=[1 1 2 2 3 3 4 4]2D array
Best Answer