필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
Chloe O'Mahony
Chloe O'Mahony 2020년 4월 27일
답변: James Tursa 2020년 4월 28일
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

채택된 답변

Adam Danz
Adam Danz 2020년 4월 27일
편집: Adam Danz 2020년 4월 28일
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.

추가 답변 (1개)

James Tursa
James Tursa 2020년 4월 28일
Another option:
b = your binary matrix
spy(b);

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by