Effacer les filtres
Effacer les filtres

how can I convert a binary matrix to a linear data?

51 vues (au cours des 30 derniers jours)
Vishnu M S
Vishnu M S le 16 Jan 2013
I have a matrix A of size 3X2. Where A(1,1)=1, A(1,2)=0, A(2,1)=1, A(2,2)=1, A(3,1)=0, A(3,2)=1. I need the data in linear array like 1 0 1 1 0 1 please help me...

Réponse acceptée

Pedro Villena
Pedro Villena le 16 Jan 2013
Modifié(e) : Pedro Villena le 17 Jan 2013
reshape(A',1,[])
  1 commentaire
Jan
Jan le 16 Jan 2013
Modifié(e) : Jan le 16 Jan 2013
Now correct with the transposition.
Equivalent:
reshape(A.', 1, [])
or:
B = B.';
B = B(:).'

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by