I have many rows such as '0' '1' '1' '0', I want all of them to make in a single column , I mean 0110 . I tried the cell2mat and cellstr but they did not work as I wanted . As shown on the picture they are seperated to 8 columns, however I want it for example in the 1x1 -> 00000001 , 2x1 -> 00000011 , 3x1 -> 00000010 ... and it goes .

4 件のコメント

Guillaume
Guillaume 2018 年 2 月 22 日
Bearing in mind that the number 00000001 and 1 are the same and that matlab always store it and display as 1, what exactly do you want to do?
Trevor Badji
Trevor Badji 2018 年 2 月 22 日
NO there are random 1's and 0's , I want them to store in pne column vector with 168 rows for this example. In summray I want that individuals in a matrix with dimensions which I wanted.
Matt J
Matt J 2018 年 2 月 22 日
You are more likely to get responses if you Accept-click answers to your previous open questions.
Guillaume
Guillaume 2018 年 2 月 22 日
編集済み: Guillaume 2018 年 2 月 22 日
You cannot have a matrix with elements
[0000001
0000011
0000010
0000100
...
]
That matrix will be stored as
[1
11
10
100
]
because in math we never write leading zeros.
So I repeat, what exactly do you want to do?

サインインしてコメントする。

 採用された回答

Matt J
Matt J 2018 年 2 月 22 日

0 投票

num2cell( cell2mat(yourArray), 2);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2018 年 2 月 22 日

編集済み:

2018 年 2 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by