Creating a cell array pattern where output is a binary matrix

15 Ansichten (letzte 30 Tage)
Kaitlyn Nicol
Kaitlyn Nicol am 20 Jan. 2022
Kommentiert: Kaitlyn Nicol am 20 Jan. 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 !

Antworten (1)

Image Analyst
Image Analyst am 20 Jan. 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'

Kategorien

Mehr zu Matrix Indexing 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