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 日

0 投票

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

3 件のコメント

mahaveer hanuman
mahaveer hanuman 2011 年 3 月 29 日
yes how can write that for for several bits
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 件)

カテゴリ

ヘルプ センター および File ExchangeBig Data Processing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by