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

4 visualizaciones (últimos 30 días)
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...

Respuesta aceptada

Pedro Villena
Pedro Villena el 16 de En. de 2013
Editada: Pedro Villena el 17 de En. de 2013
reshape(A',1,[])
  1 comentario
Jan
Jan el 16 de En. de 2013
Editada: Jan el 16 de En. de 2013
Now correct with the transposition.
Equivalent:
reshape(A.', 1, [])
or:
B = B.';
B = B(:).'

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by