function s = f(s, i) s(circshift(i, -1, 2)) = s(i);endf('abcdefghij', [1 5 8])
Standard input is empty
ans = hbcdafgeij
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!