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
One approach -
%// in_str: Input string
%// Logical masks for upper and lower case letters
upper_mask = in_str>=65 & in_str<=90 %// OR isstrprop(in_str,'upper')
lower_mask = in_str>=97 & in_str<=122 %// OR isstrprop(in_str,'lower')
%// Initialize output string
out_str = in_str
%// Replace upper letters with "flipped" upper letters; repeat for small letters
out_str(upper_mask) = char(in_str(upper_mask) + 2*(78-in_str(upper_mask))-1)
out_str(lower_mask) = char(in_str(lower_mask) + 2*(110-in_str(lower_mask))-1)
Those numbers: 78
and 110
act as the "middle numbers" for the capital and small letters ranges respectively and are used for finding differences for each letter in those two categories.
Sample run -
>> in_str,out_str
in_str =
adzC+*6AY&‘///\?abAB
out_str =
zwaX+*6ZB&‘///\?zyZY