MATLAB: How to make vector increasing same value? vector For example, I have a vector [1,2,3,4] But, I want to increase this like [1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4] I tried to if and for. But it doesn't work well. Could you recommend something? Best Answer repelem([1,2,3,4],4) Related SolutionsMATLAB: Make vectors same length One way,collection = {acc,gyr,mag};minlen = min(cellfun('length',collection));clipped=cellfun(@(z)z(1:minlen),collection,'uni',0);[acc,gyr,mag]=deal(clipped{:}) 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 QuestionMake same axes for subplotsHow to make a vector divide 1 by increasing numbersFrom a=[1 2 3 4] to b=[1 1 2 2 3 3 4 4]How can i make vector lengths the sameHow to make two vectors the same size
Best Answer