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