How I can convert a binary number into Matrix

13 vues (au cours des 30 derniers jours)
Abduellah Elbakoush
Abduellah Elbakoush le 20 Déc 2021
I have 100110101010
I want 10
01
10
10
10
10
  1 commentaire
Stephen23
Stephen23 le 20 Déc 2021
C = '100110101010'
C = '100110101010'
M = reshape(C,2,[]).'
M = 6×2 char array
'10' '01' '10' '10' '10' '10'

Connectez-vous pour commenter.

Réponse acceptée

yanqi liu
yanqi liu le 21 Déc 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

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by