Creating a cell array pattern where output is a binary matrix

15 visualizaciones (últimos 30 días)
Kaitlyn Nicol
Kaitlyn Nicol el 20 de En. de 2022
Comentada: Kaitlyn Nicol el 20 de En. de 2022
I'm looking to create a 1D cell array that gives this pattern in a binary matrix as the output.
I know that this needs to be 16x1 pattern and black = 0 and white = 1, but I am unsure where to start.
Any advice would be greatly appreciated !

Respuestas (1)

Image Analyst
Image Analyst el 20 de En. de 2022
Here's a start
v = 0 : 15
v = 1×16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
c = dec2bin(v)
c = 16×4 char array
'0000' '0001' '0010' '0011' '0100' '0101' '0110' '0111' '1000' '1001' '1010' '1011' '1100' '1101' '1110' '1111'

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by