2016-05-03 16 views
0

Ich habe (single) 3430X6906 Matrix mit nur Nullen und Einsen und ich möchte es streuen plotten. Angenommen, ich habe 1 in Spalte 30 und Zeile 40, das Diagramm sollte dot auf Punkt (30,40) haben.Streudiagramm 2D-Matrix in MATLAB

Können Sie mir bitte helfen, es zu plotten.

+1

[ 'spy'] (http://www.mathworks.com/help/matlab/ref/spy.html). – TroyHaskin

Antwort

1

Sie möchten die Zeile und Spalte mit find abrufen und diese dann unter Verwendung von plot plotten.

%// Create artificial data 
data = rand(3430, 6906) > 0.99999; 

%// Find the location of the ones 
[row, col] = find(data); 

%// Plot these locations 
plot(col, row, 'o') 

enter image description here

+0

Danke ... Es hat funktioniert ... – Aadarsh