I have a 2D binary matrix that I want to display as a black and white conspiracy. For example, suppose I have a 4-by-4 matrix:
1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 How can it be applied as a black and white matrix? Some of my input binary matrix sizes are from 100 to 9, so I would ideally need a solution that would be generalized for different size matrix.
If you want to create a crossword-type plot (with grid lines and black and white squares) So you can modify the function, A, and so on:
mat = [1 1 0 1; 0 0 0 0; 1 1 0 1; 1 0 0]; % Your sample matrix [R, C] = size (mat); Get% matrix size images ((1: c) +0.5, (1: r) +0.5, mat); % Image Theater (Brown) Plot; Set the Gray Grade Size Same (GCA, 'Exact', 1: (C + 1), 'Rectifier', 1: (R + 1), ...% Change some acid properties 'Axleme', [1C] + 1], 'Yilim', [1 R + 1], ... 'Gridline Stella', '-', 'Xgrid', 'On', 'Yogrid', 'On'); And here is the picture that you should get:
Comments
Post a Comment