how to optimize a diag matrix with sparse
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
James Tursa
2014 年 6 月 5 日
If you mean how to create the equivalent sparse matrix to your full matrix shown, try using the spdiags function instead of diag.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!