XOR operation

7 次查看(过去 30 天)
mahaveer hanuman
mahaveer hanuman 2011-3-26
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

采纳的回答

Paulo Silva
Paulo Silva 2011-3-26
a=[0 0] %example input
b=[a(1) a(2) xor(a(1),a(2))] %example output
  3 个评论
Paulo Silva
Paulo Silva 2011-3-29
a=[ 0 0; 0 1 ; 1 0 ; 1 1]
c=zeros(size(a,1),3);
c(:,1:2)=a;
b=1:size(a,1);
c(b,3)=xor(a(b,1),a(b,2))
mahaveer hanuman
mahaveer hanuman 2011-4-24
thanks

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Big Data Processing 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by