How to change the positions of elements in a vector?
37 views (last 30 days)
Guillaume on 15 May 2017
v = [v(v ~= 3), v(v == 3)]; %assuming a row vector. If column vector replace , by ;
kowshik Thopalli on 15 May 2017
Using the find() function you can do this very easily.
This gives you the positions of the elements which are equal to 3. Once you have this you can easily reorder. Hope this helps