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

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...

 채택된 답변

Pedro Villena
Pedro Villena 2013년 1월 16일
편집: Pedro Villena 2013년 1월 17일

2 개 추천

reshape(A',1,[])

댓글 수: 1

Jan
Jan 2013년 1월 16일
편집: Jan 2013년 1월 16일
Now correct with the transposition.
Equivalent:
reshape(A.', 1, [])
or:
B = B.';
B = B(:).'

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by