Creating a Sparse Matrix
Afficher commentaires plus anciens
I have a big matrix B and I get it by concatenating the small matrices.
B = [A1 M1 M2 Z1
M1' M2' Z2 A2];
But when I store this matrix, its size is very big and it takes up a lot of memory. I want to convert it to sparse matrix. The matrices Z1 and Z2 have all zero elements and, M1 and M2 also have a lot of zeros.
5 commentaires
Alex Mcaulley
le 26 Fév 2019
What is the question? you can use sparse function to convert your full matrix in sparse matrix
https://es.mathworks.com/help/matlab/ref/sparse.html
Ahmad Hasnain
le 26 Fév 2019
Alex Mcaulley
le 26 Fév 2019
yes, you should convert your small matrix to sparse and then combine them to obtain the sparse big matrix to avoid problems with memory
Jos (10584)
le 26 Fév 2019
What do you want to do with B? In other words, do you really need to create it?
Ahmad Hasnain
le 26 Fév 2019
Réponses (0)
Catégories
En savoir plus sur Sparse Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!