How to visualize a matrix?
Mostra commenti meno recenti
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 Commenti
Azzi Abdelmalek
il 7 Mar 2013
Which kind of visualization?
Timur
il 7 Mar 2013
Matt J
il 7 Mar 2013
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).
Timur
il 7 Mar 2013
Risposta accettata
Più risposte (1)
Youssef Khmou
il 7 Mar 2013
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 ,
1 Commento
Timur
il 7 Mar 2013
Categorie
Scopri di più su Surface and Mesh Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!