MATLAB: XOR operation

increasing the length of the bits by replacing it by xor resultMATLAB

input=output
[0 0]=[0 0 0] [0 1]=[0 1 1] [1 0]=[1 0 1] [1 1]=[1 1 0]
how can i get this

Best Answer

a=[0 0] %example input
b=[a(1) a(2) xor(a(1),a(2))] %example output