How can I create sparse symmetric positive definite linear system?
8 次查看(过去 30 天)
显示 更早的评论
Dear All :) I'm looking for sparse symmetric positive definite linear system Ax=b. Is it possible to generate it in Matlab? I need matrix A about 50x50 (maximum 100x100 - minimum 20x20) and vector b. It might be floating point numbers... I prefer not compressed format ;)
Thank you in advance.
D.
0 个评论
采纳的回答
Richard Brown
2013-8-6
编辑:Richard Brown
2013-8-6
sprandsym is what you want.
m = 50;
density = 2/m; % for example
rc = 0.1; % Reciprocal condition number
A = sprandsym(m, density, rc, 1);
If you don't want it in compressed column format
A = full(A);
Verify positive definiteness
chol(A);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!