Effacer les filtres
Effacer les filtres

Plot a 100x100 grid of 1's and 0's

3 vues (au cours des 30 derniers jours)
Chloe O'Mahony
Chloe O'Mahony le 27 Avr 2020
I have a 100x100 matrix of 1's and 0's that form a grid pattern with diagonal lines through it. How do I plot this on a graph for a visual representation of the pattern?
example:
1 1 1 1 1
1 0 0 1 1
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1

Réponse acceptée

Adam Danz
Adam Danz le 27 Avr 2020
Modifié(e) : Adam Danz le 28 Avr 2020
The axes will not be 'on' for imagesc or image but you should turn the axes on so you can see how the axes are arranged (particularly the y-axis).
axis on
If you plan on customizing the plot, heatmap is more difficult to work with.

Plus de réponses (1)

James Tursa
James Tursa le 28 Avr 2020
Another option:
b = your binary matrix
spy(b);

Catégories

En savoir plus sur Data Distribution Plots dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by