@(x)any(all([x;flip(x)]'==sort(x)',1)) ans('ABCDC')
Standard input is empty
ans = @(x) any (all ([x; flip(x)]' == sort (x)', 1)) ans = 0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!