How can i extract the value of an element of a sparse double?
36 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Odin Iversen
el 18 de Oct. de 2020
Comentada: Rik
el 18 de Oct. de 2020
if i have a sparse duble:
M = zeros(3);
M = sparse(M);
M(3,3) = 2;
and i want to get only the value of M(3,3) = 2, how do i do that?
if i type:
M(3,3)
i get:
ans =
(1,1) 2
but i want to somheow get:
ans =
2
converting to full matrix is not an option since the actual matrix is 50000 x 50000. thank you
0 comentarios
Respuesta aceptada
Más respuestas (2)
Rik
el 18 de Oct. de 2020
You can convert the result to a full matrix. Indexing only extracts part of the array, but doesn't influence the sparse property.
2 comentarios
Ver también
Categorías
Más información sobre Sparse Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!