MATLAB: How to subtract two matrices of character type arrays

subtract

Hello Everyone, I have two cells like the following: A{10,1,1}=[a b c d e; a b c d e; a b c d e; a b c d e]; B{2,1,1}=[a b; c d; b d; a e]; A{10,1,1}-B{2,1,1}=[c d e; a b e; a c e; b c d]; How can I subtract cell B from cell A? Can anyone help me in this regard? Thanks in advance.

Best Answer

You may consider row-wise comparison (possibly in a FOR loop)
setxor({'a','b','c','d','e'},{'a','b'})
setxor({'a','b','c','d','e'},{'c','d'})
setxor({'a','b','c','d','e'},{'b','d'})
setxor({'a','b','c','d','e'},{'a','e'})
Best,
Hang Qian