function v = f(v) v(mod(v, 2) == 1) = sort(v(mod(v, 2) == 1));endf([6 5 4 3 2 1]), f([6 5 3 1])
Standard input is empty
ans = 6 1 4 3 2 5 ans = 6 1 3 5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!