MATLAB: How to extract subscript numbers from a matrix element

extractimageImage Processing ToolboxMATLABmatrix manipulationplotsubscriptvalues

Hi, I have a sparse matrix V as you can see.
What I want to do is to extract the rows' subscript numbers and put into a vector matrix X. Example: X = (108, 120, 127, n, …).
And do the same to col's subscript numbers, putting it into Y = (1, 1, 1, 2, 2, n, …)
Than, simply plot it using plot(X, Y);
Thank you in advance!

Best Answer

[row,col] = find(V);
plot(row,col,'r+');