dedbi reverse the words that is, ‘a’ will be replaced by ‘z’, ‘b’ will be replaced by ‘y’, ‘c’ will be replaced by ‘x’ and so on. dedbi will do the same for capital letter t
Here's a way to do that:
alphabet = 'abcdefghijklmopqrstuvwxyz';
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
ralphabet = fliplr(alphabet);
RALPHABET = fliplr(ALPHABET);
txt = 'abc d ?!.< n AC';
[~, index] = ismember(txt,alphabet);
target = index ~= 0;
src = index(target);
[~, INDEX] = ismember(txt,ALPHABET);
TARGET = INDEX ~= 0;
SRC = INDEX(TARGET);
txtInvert = txt;
txtInvert(target) = ralphabet(src);
txtInvert(TARGET) = RALPHABET(SRC);
Output:
zyx w ?!.< n ZX