Its quite straightforward. See the array 'v' elementwise like this:
v=[-9 3 2 10 4 -12 14 -1];
1) First element is -9. The for loop starts with index 2 so there should be no change in first element.
2) Second element is 3. As per the for loop since the element is >t (i.e. greater than 2), you change the element to 1. Thus second element becomes 1.
3) Third element is 2. However the for loop increment order is 2 (start at 2 then 4 then 6). so execution will not enter the for loop. So no change in element and it stays as 2.
4) Fourth element is 10. As per for loop, since it is >t (i.e. greater than 2), you change the element to 1. Thus fourth element becomes 1.
5) Fifth element is 4. Again the for loop increment order is 2. so execution will not enter the for loop. So no change in element and it stays as 4.
6) Sixth element is -12. Elexution will skip the first if condition as it is not getting satisfied. The elseif condition is getting satisfied as -12<b which is -4. So you change the element to 10.
7) Seventh element is 14. Now the for loop last index is 7 but since the increment step is 2 the for loop stops at i=6. So no change in the element and it stays as 14.
8) Eighth and last element is -1 which stays as it is.
so you get your final v=[-9 1 2 1 4 10 14 -1]
Hope this explanation helps!