How do I extract subscript numbers from a matrix element?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Victor Noronha
am 10 Jun. 2014
Kommentiert: Victor Noronha
am 10 Jun. 2014
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!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Jos (10584)
am 10 Jun. 2014
help find
V = sparse(rand(5)>.5)
[x,y] = find(V)
plot(x,y,'b.')
and take a look at
help spy
spy
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!