how to optimize a diag matrix with sparse
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How to optimize this diagonal matrix using sparse :
a=diag([-ones(9,1)],-1)+diag([ones(10,1)])+diag([0 ones(1,4) 0],4)
0 Commenti
Risposte (1)
James Tursa
il 5 Giu 2014
If you mean how to create the equivalent sparse matrix to your full matrix shown, try using the spdiags function instead of diag.
0 Commenti
Vedere anche
Categorie
Scopri di più su Sparse Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!