MATLAB: Add an integer x to certain values of a vector addelementvector for example i have the number 8, and i have a vector[ 1 2 3 4 5] i need to add 8 to the elements 1-4 of the vector to get the value 18 how would i do this? Best Answer 8 + sum(YourVector(1:4)) Related SolutionsMATLAB: Add to extra elements every 4 values and enter particular values temp = reshape(vector_1, 4, []);temp = [temp; temp(1:2,:)];Vector_2 = reshape(temp, 1, []); MATLAB: Vector of integers modification Possibly:rank = [4, 1, 2, 2, 4];[~, ~, rank_new] = unique(rank) Related QuestionSum values corresponding to a number in a vectorAdding vectors in MatlabAdd n+1 element to a vectorRepeating elements of a vector in a certain mannerHow to extract a vector from a vector given a reference vector
Best Answer