How I can convert a binary number into Matrix

16 visualizzazioni (ultimi 30 giorni)
I have 100110101010
I want 10
01
10
10
10
10
  1 Commento
Stephen23
Stephen23 il 20 Dic 2021
C = '100110101010'
C = '100110101010'
M = reshape(C,2,[]).'
M = 6×2 char array
'10' '01' '10' '10' '10' '10'

Accedi per commentare.

Risposta accettata

yanqi liu
yanqi liu il 21 Dic 2021
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

Più risposte (0)

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by