%Suppose I have an array NN=[108,92,91,127]. I want a new array "E" to contain 108+92+91+127 elements in total, where the first 108 elements are also numerically equal to 108,the next 92 elements are equal to 92 and so on and so forth. The given code seems problematic, as the number of times the elements appear in E differ from the original value.
E=[];NN=[108;92;91;127];for i=1:length(NN) E=repelem(NN,NN(i));end
Best Answer