f=@(x)reshape(x((t=1:end)+(2*mod(t,2)-1).*(mod(t-1,4)>1)),2,[]) f(["DJMcMayhem"; "trichoplax"])
Standard input is empty
f = @(x) reshape (x ((t = 1:end) + (2 * mod (t, 2) - 1) .* (mod (t - 1, 4) > 1)), 2, []) ans = DrMcMoylex tJichapham
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!