How to combine two binary columns
조회 수: 9 (최근 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!