Techie Fort
Techie Fort

Reputation: 462

Scatter Plot 2D Matrix in MATLAB

I've (single) 3430X6906 matrix having only zeros and ones and I want to scatter plot it. Suppose I've 1 on column 30 and row 40, the plot should have dot on point (30,40).

Can you please help me to plot it.

Upvotes: 0

Views: 2891

Answers (1)

Suever
Suever

Reputation: 65460

You want to get the row and column using find and then plot these using plot.

%// 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

Upvotes: 1

Related Questions