f = @(x)x(1:end/2+1) f('abcdedcba')
Standard input is empty
f = @(x) x (1:end / 2 + 1) ans = abcde
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!