Cell To Array Problem

1 Ansicht (letzte 30 Tage)
Trevor Badji
Trevor Badji am 22 Feb. 2018
Bearbeitet: Guillaume am 22 Feb. 2018
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 Kommentare
Matt J
Matt J am 22 Feb. 2018
You are more likely to get responses if you Accept-click answers to your previous open questions.
Guillaume
Guillaume am 22 Feb. 2018
Bearbeitet: Guillaume am 22 Feb. 2018
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?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Matt J
Matt J am 22 Feb. 2018
num2cell( cell2mat(yourArray), 2);

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by