How to combine two binary columns
1 回表示 (過去 30 日間)
古いコメントを表示
I have a table like this: [0 1 0 0 1, 1 0 1 1 0]
and i want to combine binary the two columns in order to obtain a column like this:
[01, 10, 01, 01, 10]. Ho can I do this?
0 件のコメント
採用された回答
Fangjun Jiang
2022 年 10 月 12 日
編集済み: Fangjun Jiang
2022 年 10 月 12 日
a=[0 1 0 0 1;1 0 1 1 0]
s=sprintf('%d%d\n',a(:))
Or
b=dec2bin(a)
c=reshape(b,2,[])
d=c'
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!