How I can convert a binary number into Matrix

조회 수: 13 (최근 30일)
Abduellah Elbakoush
Abduellah Elbakoush 2021년 12월 20일
답변: yanqi liu 2021년 12월 21일
I have 100110101010
I want 10
01
10
10
10
10
  댓글 수: 1
Stephen23
Stephen23 2021년 12월 20일
C = '100110101010'
C = '100110101010'
M = reshape(C,2,[]).'
M = 6×2 char array
'10' '01' '10' '10' '10' '10'

댓글을 달려면 로그인하십시오.

채택된 답변

yanqi liu
yanqi liu 2021년 12월 21일
yes,sir,if the data is logical type,may be use the follow process,or use Stephen method to reshape
a = logical([1 0 0 1 1 0 1 0 1 0 1 0])
a = 1×12 logical array
1 0 0 1 1 0 1 0 1 0 1 0
b = [a(1:2:end)' a(2:2:end)']
b = 6×2 logical array
1 0 0 1 1 0 1 0 1 0 1 0

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by