How to visualize a matrix?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I have matrix
00001
00000
00000
01000
How I can visualize this, assuming that values "1" are points, that have to be connected by a line? I'd like to end up with such plot:
So coordinates of connected points are positions of elements in matrix that have value=1
Thanks
댓글 수: 4
Matt J
2013년 3월 7일
You don't seem to be using the same coordinate system for each point. you seems to be using 0-based coordinates for the lower-left point, which is why it lies at (0,1). However, the 0-based coordinate of the upper-right point should then be at (4,3) not (5,4).
채택된 답변
추가 답변 (1개)
Youssef Khmou
2013년 3월 7일
hi,
try simply :
f=[ 00001
00000
00000
01000];
plot(f);
You will get the same plot as your figure, except the slope starts at 3.
But in your question, one can think that you want to visualize MxN array ,
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!